package Ġcom . yo es uv . inf om adi un . menu . other . views Ċ Ċ import Ġandroidx . databinding . Data Binding Util Ċ import Ġandroid . os . Bundle Ċ import Ġandroidx . fragment . app . Fragment Ċ import Ġandroidx . recyclerview . widget . Linear LayoutManager Ċ import Ġandroid . view . LayoutInflater Ċ import Ġandroid . view . View Ċ import Ġandroid . view . ViewGroup Ċ import Ġcom . yo es uv . inf om adi un . R Ċ import Ġcom . yo es uv . inf om adi un . databinding . Child Fragment Change log Binding Ċ import Ġcom . yo es uv . inf om adi un . menu . other . adapters . Change Log Adapter Ċ import Ġcom . yo es uv . inf om adi un . menu . other . models . Change Log Model Ċ import Ġcom . yo es uv . inf om adi un . menu . other . view models . Child Fragment Change log ViewModel Ċ Ċ class ĠChild Fragment Change log : ĠFragment () Ġ{ ĊĊĠĠĠ Ġcompanion Ġobject Ġ{ ĊĠĠĠĠĠĠĠ Ġfun ĠgetInstance (): ĠFragment Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġreturn ĠChild Fragment Change log () ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġbinding : ĠChild Fragment Change log Binding ĊĠĠĠ Ġprivate Ġlateinit Ġvar ĠviewModel : ĠChild Fragment Change log ViewModel ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġadapter : ĠChange Log Adapter ĊĠĠĠ Ġprivate Ġvar Ġlist Change log : ĠMutable List < Change Log Model > Ġ= Ġarray ListOf () ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate View ( in flater : ĠLayoutInflater , Ġcontainer : ĠViewGroup ?, ĠsavedInstanceState : ĠBundle ?): ĠView ? Ġ{ ĊĠĠĠĠĠĠĠ Ġbinding Ġ= ĠData Binding Util . inflate ( in flater , ĠR . layout . child _ fragment _ changelog , Ġcontainer , Ġfalse ) ĊĠĠĠĠĠĠĠ ĠviewModel Ġ= ĠChild Fragment Change log ViewModel () ĊĠĠĠĠĠĠĠ Ġbinding . changelog Ġ= ĠviewModel ĊĊĠĠĠĠĠĠĠ Ġsetup Recycler () ĊĠĠĠĠĠĠĠ ĠviewModel . setup Data ( context ) ĊĠĠĠĠĠĠĠ ĠviewModel . list Data . observe ( view Lifecycle Owner , Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġon List Data Changed ( it !! ) ĊĠĠĠĠĠĠĠ Ġ}) ĊĊĠĠĠĠĠĠĠ Ġreturn Ġbinding . root ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġsetup Recycler (){ ĊĠĠĠĠĠĠĠ Ġbinding . re cyclerView Change log . layout Manager Ġ= ĠLinearLayoutManager ( context ) ĊĠĠĠĠĠĠĠ Ġadapter Ġ= ĠChange Log Adapter ( context , Ġlist Change log ) ĊĠĠĠĠĠĠĠ Ġbinding . re cyclerView Change log . adapter Ġ= Ġadapter ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġon List Data Changed ( list Data : ĠMutable List < Change Log Model > ){ ĊĠĠĠĠĠĠĠ Ġlist Change log . clear () ĊĠĠĠĠĠĠĠ Ġlist Change log . addAll ( list Data ) ĊĠĠĠĠĠĠĠ Ġbinding . re cyclerView Change log . post Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġadapter . notify DataSet Changed () ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ Ċ }