package Ġbr . com . comp asso . markup . ui . fragments Ċ Ċ import Ġandroid . os . Bundle Ċ import Ġandroid . view . LayoutInflater Ċ import Ġandroid . view . View Ċ import Ġandroid . view . ViewGroup Ċ import Ġbr . com . comp asso . markup . databinding . Fragment F avorites Binding Ċ import Ġbr . com . comp asso . markup . ui . adapters . Favorite Event Adapter Ċ import Ġbr . com . comp asso . markup . ui . view models . Events ViewModel Ċ import Ġorg . k oin . android . ext . android . inject Ċ import Ġorg . k oin . android . view model . ext . android . viewModel Ċ Ċ class ĠF avorites Fragment Ġ: ĠBase Fragment () Ġ{ ĊĠĠĠ Ġprivate Ġval Ġbinding Ġby Ġlazy Ġ{ ĠFragment F avorites Binding . inflate ( layout Inflater ) Ġ} ĊĠĠĠ Ġprivate Ġval Ġfavorite Adapter Ġby Ġinject < Favorite Event Adapter >() ĊĠĠĠ Ġprivate Ġval Ġevents ViewModel Ġby ĠviewModel < Events ViewModel >() ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate View ( ĊĠĠĠĠĠĠĠ Ġinflater : ĠLayoutInflater , ĊĠĠĠĠĠĠĠ Ġcontainer : ĠViewGroup ?, ĊĠĠĠĠĠĠĠ ĠsavedInstanceState : ĠBundle ? ĊĠĠĠ Ġ): ĠView Ġ{ ĊĠĠĠĠĠĠĠ Ġbinding . favorites . adapter Ġ= Ġfavorite Adapter ĊĠĠĠĠĠĠĠ Ġreturn Ġbinding . root ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon View Created ( view : ĠView , ĠsavedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . on View Created ( view , ĠsavedInstanceState ) ĊĠĠĠĠĠĠĠ Ġload F avorites () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġload F avorites () Ġ{ ĊĠĠĠĠĠĠĠ Ġevents ViewModel . favorites (). observe ( view Lifecycle Owner , Ġ{ Ġevents Ġ-> ĊĠĠĠĠĠĠĠĠĠĠĠ Ġfavorite Adapter . addAll ( events ) ĊĠĠĠĠĠĠĠ Ġ}) ĊĠĠĠ Ġ} Ċ }