package Ġinfo . co div e . template . acc . view Ċ Ċ import Ġandroidx . appcompat . app . AppCompatActivity Ċ import Ġandroid . os . Bundle Ċ import Ġandroidx . lifecycle . ViewModel Provider Ċ import Ġandroidx . recyclerview . widget . Divider Item Decoration Ċ import Ġandroidx . recyclerview . widget . RecyclerView Ċ import Ġinfo . co div e . template . acc . R Ċ import Ġinfo . co div e . template . acc . databinding . Activity Sample Binding Ċ import Ġinfo . co div e . template . acc . model . Sample Repository Ċ import Ġinfo . co div e . template . acc . view . sample view . Sample Recycler Adapter Ċ import Ġinfo . co div e . template . acc . view . sample view . Sample ViewModel Ċ import Ġinfo . co div e . template . acc . view . sample view . Sample ViewModel Factory Ċ import Ġinfo . co div e . template . acc . model . database . Sample Database Ċ Ċ class ĠSample Activity Ġ: ĠAppCompatActivity () Ġ{ ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġbinding : ĠActivity Sample Binding ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate ( savedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . onCreate ( savedInstanceState ) ĊĠĠĠĠĠĠĠ Ġbinding Ġ= ĠActivity Sample Binding . inflate ( layout Inflater ) ĊĠĠĠĠĠĠĠ ĠsetContentView ( binding . root ) ĊĊĠĠĠĠĠĠĠ Ġval Ġsample Table Dao Ġ= ĠSample Database . getInstance ( this ). sample Table Dao ĊĠĠĠĠĠĠĠ Ġval Ġrepository Ġ= ĠSample Repository ( sample Table Dao ) ĊĠĠĠĠĠĠĠ Ġval ĠviewModel Factory Ġ= ĠSample ViewModel Factory ( repository ) ĊĠĠĠĠĠĠĠ Ġval ĠviewModel Ġ= ĠViewModel Provider ( this , ĠviewModel Factory ). get ( Sample ViewModel :: class . java ) ĊĊĠĠĠĠĠĠĠ Ġval Ġadapter Ġ= ĠSample Recycler Adapter () ĊĠĠĠĠĠĠĠ Ġbinding . sample RecyclerView . adapter Ġ= Ġadapter ĊĠĠĠĠĠĠĠ Ġval Ġitem Decoration Ġ= ĠDiv ider Item Decoration ( this , ĠDiv ider Item Decoration . VERTICAL ) ĊĠĠĠĠĠĠĠ Ġbinding . sample RecyclerView . addItem Decoration ( item Decoration ) ĊĊĠĠĠĠĠĠĠ ĠviewModel . sample Array . observe ( this ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġadapter . submit List ( it ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ }