package Ġnet . sar ang nam u . eh an ex . view models Ċ Ċ import Ġandroid . app . Application Ċ import Ġandroidx . databinding . Observable Field Ċ import Ġandroidx . fragment . app . FragmentManager Ċ import Ġandroidx . fragment . app . Fragment State Pager Adapter Ċ import Ġandroidx . lifecycle . Android ViewModel Ċ import Ġnet . sar ang nam u . eh an ex . views . member . Member Cop or ate Fragment Ċ import Ġnet . sar ang nam u . eh an ex . views . member . Member Individual Fragment Ċ import Ġnet . sar ang nam u . eh an ex . views . member . Member O verse as Fragment Ċ Ċ /** Ċ Ġ* ĠCreated Ġby Ġ< a Ġhref =" mailto : auc d 2 9 @ han wh a . com "> Bur ke ĠCh oi </ a > Ġon Ġ 2 0 1 8 . Ġ 1 1 . Ġ 1 6 . Ġ< p /> Ċ Ġ*/ Ċ Ċ class ĠMember ViewModel ( application : ĠApplication ) Ġ: ĠAndroid ViewModel ( application ) Ġ{ ĊĠĠĠ Ġval Ġadapter Ġ= ĠObservable Field < Member Tab Pager Adapter >() Ċ } Ċ Ċ class ĠMember Tab Pager Adapter ( fm : ĠFragment Manager ?) Ġ: ĠFragment State Pager Adapter ( fm ) Ġ{ ĊĠĠĠ Ġcompanion Ġobject Ġ{ ĊĠĠĠĠĠĠĠ Ġconst Ġval ĠCOUNT Ġ= Ġ 3 ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun ĠgetItem ( position : ĠInt ) Ġ= ĊĠĠĠĠĠĠĠ Ġwhen Ġ( position ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠ 1 ĠĠĠ Ġ-> ĠMember Cop or ate Fragment () ĊĠĠĠĠĠĠĠĠĠĠĠĠ 2 ĠĠĠ Ġ-> ĠMember O verse as Fragment () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġelse Ġ-> ĠMember Individual Fragment () ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġget Count () Ġ= ĠCOUNT Ċ }