package Ġcom . f riday tech . dex . presentation . deprecated . mark ets Ċ Ċ import Ġandroid . os . Bundle Ċ import Ġandroid . view . View Ċ import Ġandroidx . lifecycle . Observer Ċ import Ġandroidx . lifecycle . ViewModel Providers Ċ import Ġandroidx . recyclerview . widget . Linear LayoutManager Ċ import Ġcom . f riday tech . dex . R Ċ import Ġcom . f riday tech . dex . core . ui . Core Fragment Ċ import Ġcom . f riday tech . dex . presentation . deprecated . mark ets . recycler . Market ViewHolder Ċ import Ġcom . f riday tech . dex . presentation . deprecated . mark ets . recycler . Mark ets Adapter Ċ import Ġcom . f riday tech . dex . presentation . main . IF ocus Listener Ċ import Ġcom . f riday tech . dex . presentation . stats chart . Chart Info Dialog Ċ import Ġcom . f riday tech . dex . utils . visible Ċ import Ġkotlinx . android . synt hetic . main . fragment _ mark ets .* Ċ Ċ class ĠMark ets Fragment Ġ: ĠCore Fragment ( R . layout . fragment _ mark ets ), ĠMarket ViewHolder . Listener , ĊĠĠĠ ĠIF ocus Listener Ġ{ ĊĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġadapter : ĠMark ets Adapter ĊĠĠĠ Ġprivate Ġlateinit Ġvar ĠviewModel : ĠMark ets ViewModel ĊĊĠĠĠ Ġ// region ĠLifecycle ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate ( savedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . onCreate ( savedInstanceState ) ĊĠĠĠĠĠĠĠ Ġadapter Ġ= ĠMark ets Adapter ( this ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Activity Created ( savedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . on Activity Created ( savedInstanceState ) ĊĠĠĠĠĠĠĠ ĠviewModel Ġ= ĠViewModel Providers . of ( this ). get ( Mark ets ViewModel :: class . java ) ĊĊĠĠĠĠĠĠĠ ĠviewModel . mark ets . observe ( this , ĠObserver Ġ{ Ġadapter . set Mark ets ( it ) Ġ}) ĊĊĠĠĠĠĠĠĠ ĠviewModel . loading . observe ( this , ĠObserver Ġ{ Ġmark ets _ refresh ?. is Refresh ing Ġ= Ġit Ġ}) ĊĊĠĠĠĠĠĠĠ ĠviewModel . open Market Info Event . observe ( this , ĠObserver Ġ{ Ġcoin Code Ġ-> ĊĠĠĠĠĠĠĠĠĠĠĠ Ġactivity ?. let Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠChart Info Dialog . show ( it . support FragmentManager , Ġcoin Code ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġ}) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon View Created ( view : ĠView , ĠsavedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . on View Created ( view , ĠsavedInstanceState ) ĊĊĠĠĠĠĠĠĠ Ġmark ets _ recycler ?. layout Manager Ġ= ĠLinearLayoutManager ( context ) ĊĠĠĠĠĠĠĠ Ġmark ets _ recycler ?. adapter Ġ= Ġadapter ĊĊĠĠĠĠĠĠĠ Ġmark ets _ refresh ?. setOn Refresh Listener Ġ{ ĠviewModel . refresh () Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ// endregion ĊĊĠĠĠ Ġoverride Ġfun Ġon Focused () Ġ{ ĊĠĠĠĠĠĠĠ Ġcoord inator ?. visible Ġ= Ġtrue ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ// region ĠViewHolder ĊĊĠĠĠ Ġoverride Ġfun ĠonClick ( position : ĠInt ) Ġ{ ĊĠĠĠĠĠĠĠ ĠviewModel . on Market Click ( position ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ// endregion ĊĊĠĠĠ Ġcompanion Ġobject Ġ{ ĊĠĠĠĠĠĠĠ Ġfun Ġnew Instance () Ġ= ĠMark ets Fragment () ĊĠĠĠ Ġ} Ċ } Ċ