package Ġio . horizontal systems . bank wallet . modules . crypt on ews Ċ Ċ import Ġandroid . os . Bundle Ċ import Ġandroid . view . LayoutInflater Ċ import Ġandroid . view . View Ċ import Ġandroid . view . ViewGroup Ċ import Ġandroidx . fragment . app . Fragment Ċ import Ġandroidx . lifecycle . Observer Ċ import Ġandroidx . lifecycle . ViewModel Provider Ċ import Ġio . horizontal systems . bank wallet . R Ċ import Ġkotlinx . android . synt hetic . main . fragment _ crypto _ news .* Ċ Ċ class ĠCrypto News Fragment ( private Ġval Ġcoin Code : ĠString ) Ġ: ĠFragment () Ġ{ ĊĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġpresenter : ĠCrypto News Presenter ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġcrypto News View : ĠCrypto News View ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġadapter : ĠCrypto News Adapter ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate View ( in flater : ĠLayoutInflater , Ġcontainer : ĠViewGroup ?, ĠsavedInstanceState : ĠBundle ?): ĠView ? Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġinflater . inflate ( R . layout . fragment _ crypto _ news , Ġcontainer , Ġfalse ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon View Created ( view : ĠView , ĠsavedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . on View Created ( view , ĠsavedInstanceState ) ĊĊĠĠĠĠĠĠĠ Ġpresenter Ġ= ĠViewModel Provider ( this , ĠCrypto News Module . Factory ( coin Code )). get ( Crypto News Presenter :: class . java ) ĊĠĠĠĠĠĠĠ Ġcrypto News View Ġ= Ġpresenter . view Ġas ĠCrypto News View ĊĠĠĠĠĠĠĠ Ġadapter Ġ= ĠCrypto News Adapter () ĊĊĠĠĠĠĠĠĠ Ġnews RecyclerView . adapter Ġ= Ġadapter ĊĠĠĠĠĠĠĠ Ġobserve Events () ĊĊĠĠĠĠĠĠĠ Ġpresenter . on Load () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġobserve Events () Ġ{ ĊĠĠĠĠĠĠĠ Ġcrypto News View . show News . observe ( this , ĠObserver Ġ{ Ġitems Ġ-> ĊĠĠĠĠĠĠĠĠĠĠĠ Ġadapter . submit List ( items ) ĊĠĠĠĠĠĠĠ Ġ}) ĊĊĠĠĠĠĠĠĠ Ġcrypto News View . show Spinner . observe ( this , ĠObserver Ġ{ Ġshow Ġ-> ĊĠĠĠĠĠĠĠĠĠĠĠ Ġspinner . visibility Ġ= Ġif Ġ( show ) ĠView . VISIBLE Ġelse ĠView . GONE ĊĠĠĠĠĠĠĠĠĠĠĠ Ġnot Available . visibility Ġ= ĠView . GONE ĊĠĠĠĠĠĠĠ Ġ}) ĊĊĠĠĠĠĠĠĠ Ġcrypto News View . show Error . observe ( this , ĠObserver Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġnot Available . visibility Ġ= ĠView . VISIBLE ĊĠĠĠĠĠĠĠ Ġ}) ĊĠĠĠ Ġ} Ċ } Ċ