package Ġcom . binary br icks . co iny . stories . coin details Ċ Ċ import ĠCoin Details Contract Ċ import Ġandroid . os . Bundle Ċ import Ġandroid . support . design . widget . Snackbar Ċ import Ġandroid . support . v 4 . app . Fragment Ċ import Ġandroid . support . v 7 . widget . Divider Item Decoration Ċ import Ġandroid . support . v 7 . widget . Linear LayoutManager Ċ import Ġandroid . view . LayoutInflater Ċ import Ġandroid . view . View Ċ import Ġandroid . view . ViewGroup Ċ import Ġcom . binary br icks . co iny . R Ċ import Ġcom . binary br icks . co iny . components . About Coin Module Ċ import Ġcom . binary br icks . co iny . components . Add Coin Module Ċ import Ġcom . binary br icks . co iny . components . Coin Info Module Ċ import Ġcom . binary br icks . co iny . components . Coin Stat st ics Module Ċ import Ġcom . binary br icks . co iny . components . crypt on ews module . Coin News Module Ċ import Ġcom . binary br icks . co iny . components . h istorical chart module . Coin Details Presenter Ċ import Ġcom . binary br icks . co iny . components . h istorical chart module . H istorical Chart Module Ċ import Ġcom . binary br icks . co iny . data . Preference Helper Ċ import Ġcom . binary br icks . co iny . data . database . entities . W atched Coin Ċ import Ġcom . binary br icks . co iny . network . models . Coin Price Ċ import Ġcom . binary br icks . co iny . network . schedul ers . Scheduler Provider Ċ import Ġcom . binary br icks . co iny . utils .* Ċ import Ġkotlinx . android . synt hetic . main . activity _ all _ coin _ details .* Ċ import Ġkotlinx . android . synt hetic . main . fragment _ coin _ details .* Ċ import Ġkotlinx . android . synt hetic . main . fragment _ coin _ details . view .* ĊĊ Ċ class ĠCoin Details Fragment Ġ: ĠFragment (), ĠCoin Details Contract . View Ġ{ ĊĊĠĠĠ Ġprivate Ġval Ġcoin Detail List : ĠMutable List < Any > Ġ= ĠArrayList () ĊĠĠĠ Ġprivate Ġvar Ġcoin Details Adapter : ĠCoin Details Adapter ? Ġ= Ġnull ĊĊĠĠĠ Ġprivate Ġval Ġscheduler Provider : ĠScheduler Provider Ġby Ġlazy Ġ{ ĊĠĠĠĠĠĠĠ ĠScheduler Provider . getInstance () ĊĠĠĠ Ġ} ĊĠĠĠ Ġprivate Ġval Ġcoin Details Presenter : ĠCoin Details Presenter Ġby Ġlazy Ġ{ ĊĠĠĠĠĠĠĠ ĠCoin Details Presenter ( scheduler Provider ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġval Ġresource Provider : ĠResource Provider Ġby Ġlazy Ġ{ ĊĠĠĠĠĠĠĠ ĠResource Provider Impl ( activity ) ĊĠĠĠ Ġ} ĊĠĠĠ Ġval Ġto Currency : ĠString Ġby Ġlazy Ġ{ ĊĠĠĠĠĠĠĠ ĠPreference Helper . getDefault Currency ( context ?. application Context ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġcompanion Ġobject Ġ{ ĊĠĠĠĠĠĠĠ Ġprivate Ġconst Ġval ĠW ATCH ED _ CO IN Ġ= Ġ" WATCH ED _ CO IN " ĊĠĠĠĠĠĠĠ Ġ@ Jvm Static ĊĠĠĠĠĠĠĠ Ġfun Ġget Argument Bundle ( w atched Coin : ĠW atched Coin ): ĠBundle Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġbundle Ġ= ĠBundle () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġbundle . put Parcelable ( WATCH ED _ CO IN , Ġw atched Coin ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġreturn Ġbundle ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĊĠĠĠ Ġoverride Ġfun ĠonCreate View ( in flater : ĠLayoutInflater , Ġcontainer : ĠViewGroup ?, ĠsavedInstanceState : ĠBundle ?): ĠView ? Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġinf late Ġ= Ġinflater . inflate ( R . layout . fragment _ coin _ details , Ġcontainer , Ġfalse ) ĊĊĠĠĠĠĠĠĠ Ġval Ġw atched Coin Ġ= Ġarguments ?. get Parcelable < W atched Coin >( WATCH ED _ CO IN ) ĊĊĠĠĠĠĠĠĠ Ġif Ġ( w atched Coin Ġ!= Ġnull ) Ġ{ ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġcoin Details Presenter . attach View ( this ) ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġlifecycle . add Observer ( coin Details Presenter ) ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġinf late . rv Coin Details . layout Manager Ġ= ĠLinearLayoutManager ( context ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġinf late . rv Coin Details . addItem Decoration ( Divider Item Decoration ( context , ĠDiv ider Item Decoration . VERTICAL )) ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġtool Bar Default Elevation Ġ= Ġdp To Px ( context , Ġ 1 2 ) Ġ// Ġdefault Ġelevation Ġof Ġtoolbar ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġinf late . rv Coin Details . add On Scroll Listener ( object Ġ: ĠOn Vertical Scroll Listener () Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġoverride Ġfun Ġon Sc rolled ( offset : ĠInt ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġsuper . on Sc rolled ( offset ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ( activity Ġas ĠCoin Details Pager Activity ). toolbar ?. elevation Ġ= ĠMath . min ( tool Bar Default Elevation . toFloat (), Ġoffset . toFloat ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ( activity Ġas ĠCoin Details Pager Activity ). tool Bar Tab ?. elevation Ġ= ĠMath . min ( tool Bar Default Elevation . toFloat (), Ġoffset . toFloat ()) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ}) ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġshow Or Hide Loading Indicator ( true ) ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġ// Ġload Ġdata ĊĠĠĠĠĠĠĠĠĠĠĠ Ġcoin Details Presenter . load Current Coin Price ( w atched Coin , Ġto Currency ) ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġreturn Ġinf late ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Network Error ( errorMessage : ĠString ) Ġ{ ĊĠĠĠĠĠĠĠ ĠSn ackbar . make ( rv Coin Details , ĠerrorMessage , ĠSn ackbar . LENGTH _ LONG ). show () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġshow Or Hide Loading Indicator ( show Loading : ĠBoolean ) Ġ{ ĊĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Coin Price Loaded ( coin Price : ĠCoin Price ?, Ġw atched Coin : ĠW atched Coin ) Ġ{ ĊĠĠĠĠĠĠĠ Ġcoin Detail List . add ( H istorical Chart Module . H istorical Chart Module Data ( coin Price )) ĊĊĠĠĠĠĠĠĠ Ġcoin Detail List . add ( Add Coin Module . Add Coin Module Data ()) ĊĊĠĠĠĠĠĠĠ Ġif Ġ( coin Price Ġ!= Ġnull ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġcoin Detail List . add ( Coin Stat st ics Module . Coin Stat st ics Module Data ( coin Price )) ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġcoin Detail List . add ( Coin Info Module . Coin Info Module Data ( coin Price ?. market ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ?: Ġdefault Exchange , Ġw atched Coin . coin . algorithm , Ġw atched Coin . coin . proof Type )) ĊĊĠĠĠĠĠĠĠ Ġcoin Detail List . add ( Coin News Module . Coin News Module Data ()) ĊĊĠĠĠĠĠĠĠ Ġcoin Detail List . add ( About Coin Module . About Coin Module Data ( get About String For Coin ( w atched Coin . coin . symbol , Ġcontext ?. application Context ))) ĊĠĠĠĠĠĠĠ Ġcoin Details Adapter Ġ= ĠCoin Details Adapter ( w atched Coin . coin . symbol , Ġto Currency , Ġw atched Coin . coin . fullName , Ġlifecycle , Ġcoin Detail List , Ġscheduler Provider , Ġresource Provider ) ĊĊĠĠĠĠĠĠĠ Ġview ?. rv Coin Details ?. adapter Ġ= Ġcoin Details Adapter ĊĠĠĠĠĠĠĠ Ġcoin Details Adapter ?. notify DataSet Changed () ĊĠĠĠ Ġ} Ċ } Ċ