package Ġcom . erik rio set i awan . cin em am ov ies . adapter Ċ Ċ import Ġandroidx . fragment . app . Fragment Ċ import Ġandroidx . fragment . app . FragmentManager Ċ import Ġandroidx . fragment . app . Fragment State Pager Adapter Ċ Ċ class ĠMy Pager Adapter ( fragment Manager : ĠFragment Manager ) Ġ: ĠFragment State Pager Adapter ( fragment Manager ) Ġ{ ĊĊĠĠĠ Ġprivate Ġval Ġfragment List : ĠArrayList < Fragment > Ġ= ĠArrayList () ĊĠĠĠ Ġprivate Ġval Ġfragment Title List : ĠArrayList < String > Ġ= ĠArrayList () ĊĊĠĠĠ Ġoverride Ġfun ĠgetItem ( position : ĠInt ): ĠFragment Ġ= Ġfragment List [ position ] ĊĊĠĠĠ Ġoverride Ġfun Ġget Count (): ĠInt Ġ= Ġfragment List . size ĊĊĠĠĠ Ġoverride Ġfun Ġget Page Title ( position : ĠInt ): ĠCharSequence ? Ġ= Ġfragment Title List [ position ] ĊĊĠĠĠ Ġfun Ġadd Fragment ( fragment : ĠFragment , Ġtitle : ĠString ) Ġ{ ĊĠĠĠĠĠĠĠ Ġfragment List . add ( fragment ) ĊĠĠĠĠĠĠĠ Ġfragment Title List . add ( title ) ĊĠĠĠ Ġ} Ċ }