package Ġcom . ch ic ag or ob oto . features . sessions Ċ Ċ import Ġandroidx . fragment . app . Fragment Ċ import Ġandroidx . view pager 2 . adapter . Fragment State Adapter Ċ import Ġandroidx . view pager 2 . widget . ViewPager 2 Ċ import Ġcom . ch ic ag or ob oto . features . sessions . Session Date Presenter . Model . Session Date Ċ import Ġcom . google . android . material . tabs . Tab Layout Ċ import Ġcom . google . android . material . tabs . Tab Layout Mediator Ċ Ċ internal Ġclass ĠSession Pager Adapter ( fragment : ĠFragment ) Ġ: ĠFragment State Adapter ( fragment ) Ġ{ ĊĊĠ Ġval Ġdates : ĠMutable List < Session Date > Ġ= Ġmutable ListOf () ĊĊĠ Ġoverride Ġfun ĠgetItem Count (): ĠInt Ġ= Ġdates . size ĊĊĠ Ġoverride Ġfun Ġcreate Fragment ( position : ĠInt ): ĠFragment Ġ= ĊĠĠĠĠĠ ĠSession List Fragment . create ( dates [ position ]. id ) ĊĊĠ Ġfun Ġmedi ate Tabs ( tab Layout : ĠTab Layout , Ġview Pager : ĠView Pager 2 ) Ġ{ ĊĠĠĠ ĠTab Layout Mediator ( tab Layout , Ġview Pager ) Ġ{ Ġtab , Ġposition Ġ-> ĊĠĠĠĠĠ Ġtab . text Ġ= Ġdates [ position ]. name ĊĠĠĠ Ġ}. attach () ĊĠ Ġ} Ċ } Ċ