package Ġcom . ek o app . ek os dk . u ikit . community . news feed . fragment Ċ Ċ import Ġandroid . content . Context Ċ import Ġandroid . os . Bundle Ċ import Ġandroid . view . LayoutInflater Ċ import Ġandroid . view . View Ċ import Ġandroid . view . ViewGroup Ċ import Ġandroidx . appcompat . app . AppCompatActivity Ċ import Ġandroidx . databinding . Data Binding Util Ċ import Ġandroidx . fragment . app . activity ViewModels Ċ import Ġandroidx . lifecycle . ViewModel Provider Ċ import Ġcom . ek o app . ek os dk . feed . E ko Post Ċ import Ġcom . ek o app . ek os dk . u ikit . community . R Ċ import Ġcom . ek o app . ek os dk . u ikit . community . databinding . Am ity View My Timeline Feed Empty Binding Ċ import Ġcom . ek o app . ek os dk . u ikit . community . news feed . listener . I Avatar ClickListener Ċ import Ġcom . ek o app . ek os dk . u ikit . community . news feed . listener . IP ost ItemClickListener Ċ import Ġcom . ek o app . ek os dk . u ikit . community . news feed . listener . IP ost Option ClickListener Ċ import Ġcom . ek o app . ek os dk . u ikit . community . news feed . util . E ko Timeline Type Ċ import Ġcom . ek o app . ek os dk . u ikit . community . news feed . view model . E ko Base Feed ViewModel Ċ import Ġcom . ek o app . ek os dk . u ikit . community . news feed . view model . E ko Global Feed ViewModel Ċ import Ġcom . ek o app . ek os dk . u ikit . community . news feed . view model . E ko News Feed ViewModel Ċ import Ġcom . ek o app . ek os dk . u ikit . community . utils . E ko Community Navigation Ċ import Ġcom . ek o app . ek os dk . u ikit . model . Event Identifier Ċ import Ġcom . ek o app . ek os dk . u ikit . feed . settings . IP ost Share ClickListener Ċ import Ġcom . ek o app . ek os dk . user . E ko User Ċ Ċ class ĠE ko Global Feed Fragment Ġinternal Ġconstructor () Ġ: ĠE ko Base Feed Fragment () Ġ{ ĊĊĠĠĠ Ġlateinit Ġvar Ġm ViewModel : ĠE ko Global Feed ViewModel ĊĠĠĠ Ġprivate Ġval Ġnews Feed ViewModel : ĠE ko News Feed ViewModel Ġby Ġactivity ViewModels () ĊĠĠĠ Ġprivate Ġvar Ġempty View Binding : ĠAm ity View My Timeline Feed Empty Binding ? Ġ= Ġnull ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate View ( in flater : ĠLayoutInflater , Ġcontainer : ĠViewGroup ?, ĠsavedInstanceState : ĠBundle ?): ĠView ? Ġ{ ĊĠĠĠĠĠĠĠ Ġm ViewModel Ġ= ĠViewModel Provider ( require Activity ()). get ( E ko Global Feed ViewModel :: class . java ) ĊĠĠĠĠĠĠĠ Ġreturn Ġsuper . onCreate View ( in flater , Ġcontainer , ĠsavedInstanceState ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġget Feed Type (): ĠE ko Timeline Type Ġ= ĠE ko Timeline Type . GLOBAL ĊĊĠĠĠ Ġoverride Ġfun Ġget ViewModel (): ĠE ko Base Feed ViewModel Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġm ViewModel ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġget Empty View (): ĠView Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġinflater Ġ= Ġrequire Context (). getSystem Service ( Context . LAYOUT _ IN FL ATER _ SERVICE ) Ġas ĠLayoutInflater ĊĠĠĠĠĠĠĠ Ġempty View Binding Ġ= ĠData Binding Util . inflate ( in flater , ĠR . layout . am ity _ view _ my _ timeline _ feed _ empty , Ġget Root View (), Ġfalse ) ĊĠĠĠĠĠĠĠ Ġreturn Ġempty View Binding !!. root ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġhandle Empty List ( is List Empty : ĠBoolean ) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . handle Empty List ( is List Empty ) ĊĠĠĠĠĠĠĠ Ġval Ġis Data Obj Empty Ġ= Ġis List Empty Ġ&& Ġparent Fragment Ġ!= Ġnull Ġ&& Ġparent Fragment Ġis ĠE ko News Feed Fragment ĊĠĠĠĠĠĠĠ Ġnews Feed ViewModel . trigger Event ( Event Identifier . EMPTY _ GLOBAL _ FEED , Ġis Data Obj Empty ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun ĠonClick User Avatar ( feed : ĠE ko Post , Ġuser : ĠE ko User , Ġposition : ĠInt ) Ġ{ ĊĠĠĠĠĠĠĠ Ġif Ġ( m ViewModel . avatar ClickListener Ġ!= Ġnull ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġm ViewModel . avatar ClickListener ?. onClick User Avatar ( user ) ĊĠĠĠĠĠĠĠ Ġ} Ġelse Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠE ko Community Navigation . navigate To UserProfile ( require Context (), Ġuser . getUserId ()) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġclass ĠBuilder Ġ{ ĊĠĠĠĠĠĠĠ Ġprivate Ġvar Ġpost ItemClickListener : ĠI Post ItemClickListener ? Ġ= Ġnull ĊĠĠĠĠĠĠĠ Ġprivate Ġvar Ġpost Option ClickListener : ĠI Post Option ClickListener ? Ġ= Ġnull ĊĠĠĠĠĠĠĠ Ġprivate Ġvar Ġavatar ClickListener : ĠI Avatar ClickListener ? Ġ= Ġnull ĊĠĠĠĠĠĠĠ Ġprivate Ġvar Ġpost Share ClickListener : ĠI Post Share ClickListener ? Ġ= Ġnull ĊĊĠĠĠĠĠĠĠ Ġfun Ġbuild ( activity : ĠAppCompatActivity ): ĠE ko Global Feed Fragment Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġfragment Ġ= ĠE ko Global Feed Fragment () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġfragment . m ViewModel Ġ= ĠViewModel Provider ( activity ). get ( E ko Global Feed ViewModel :: class . java ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġfragment . m ViewModel . post ItemClickListener Ġ= Ġpost ItemClickListener ĊĠĠĠĠĠĠĠĠĠĠĠ Ġfragment . m ViewModel . post Option ClickListener Ġ= Ġpost Option ClickListener ĊĠĠĠĠĠĠĠĠĠĠĠ Ġfragment . m ViewModel . avatar ClickListener Ġ= Ġavatar ClickListener ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġif ( post Share ClickListener Ġ!= Ġnull ){ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġfragment . m ViewModel . post Share ClickListener Ġ= Ġpost Share ClickListener ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġreturn ĠE ko Global Feed Fragment () ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġprivate Ġfun Ġpost ItemClickListener ( on Post ItemClickListener : ĠI Post ItemClickListener ): ĠBuilder Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġreturn Ġapply Ġ{ Ġthis . post ItemClickListener Ġ= Ġon Post ItemClickListener Ġ} ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġprivate Ġfun Ġpost Option ClickListener ( on Post Option ClickListener : ĠI Post Option ClickListener ): ĠBuilder Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġreturn Ġapply Ġ{ Ġthis . post Option ClickListener Ġ= Ġon Post Option ClickListener Ġ} ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġfun ĠonClick User Avatar ( on Avatar ClickListener : ĠI Avatar ClickListener ?): ĠBuilder Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġreturn Ġapply Ġ{ Ġthis . avatar ClickListener Ġ= Ġon Avatar ClickListener Ġ} ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġfun Ġpost Share ClickListener ( on Post Share ClickListener : ĠI Post Share ClickListener ): ĠBuilder Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġreturn Ġapply Ġ{ Ġthis . post Share ClickListener Ġ= Ġon Post Share ClickListener Ġ} ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ }