package Ġcom . gar min . android . use less application . fragment Ċ Ċ import Ġandroid . os . Bundle Ċ import Ġandroid . util . Log Ċ import Ġandroidx . fragment . app . Fragment Ċ import Ġandroid . view . LayoutInflater Ċ import Ġandroid . view . View Ċ import Ġandroid . view . ViewGroup Ċ import Ġandroidx . lifecycle . Observer Ċ import Ġandroidx . lifecycle . ViewModel Providers Ċ import Ġandroidx . recyclerview . widget . Linear LayoutManager Ċ import Ġcom . gar min . android . use less application . R Ċ import Ġcom . gar min . android . use less application . adapter . Statistics Adapter Ċ import Ġcom . gar min . android . use less application . model . Statistics Data File Ċ import Ġcom . gar min . android . use less application . view model . Storage ViewModel Ċ import Ġkotlinx . android . synt hetic . main . fragment _ statistics . view .* ĊĊ Ċ class ĠStatistics Fragment Ġ: ĠFragment () Ġ{ ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġm ViewModel : ĠStorage ViewModel ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġm Adapter : ĠStatistics Adapter ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate ( savedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . onCreate ( savedInstanceState ) ĊĠĠĠĠĠĠĠ Ġm ViewModel Ġ= ĠViewModel Providers . of ( require Activity ()) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. get ( Storage ViewModel :: class . java ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. apply Ġ{ Ġget Internal Files () Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate View ( ĊĠĠĠĠĠĠĠ Ġinflater : ĠLayoutInflater , Ġcontainer : ĠViewGroup ?, ĊĠĠĠĠĠĠĠ ĠsavedInstanceState : ĠBundle ? ĊĠĠĠ Ġ): ĠView ? Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġview Ġ= Ġinflater . inflate ( R . layout . fragment _ statistics , Ġcontainer , Ġfalse ) ĊĠĠĠĠĠĠĠ Ġview . recycler _ view _ statistics . apply Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġlayout Manager Ġ= ĠLinearLayoutManager ( activity ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġm Adapter Ġ= ĠStatistics Adapter ( m ViewModel . get Stat istical Files () Ġ?: ĠlistOf ()) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġm ViewModel . m FileList . observe ( this @ Statistics Fragment , ĠObserver Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġm Adapter . data Changed ( m ViewModel . get Stat istical Files () Ġ?: ĠlistOf ()) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ}) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġadapter Ġ= Ġm Adapter ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġreturn Ġview ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġcompanion Ġobject Ġ{ ĊĠĠĠĠĠĠĠ Ġfun Ġnew Instance () Ġ= ĊĠĠĠĠĠĠĠĠĠĠĠ ĠStatistics Fragment () ĊĠĠĠ Ġ} Ċ }