package Ġio . nova foundation . nova . feature _ assets . presentation . balance . detail Ċ Ċ import Ġandroid . os . Bundle Ċ import Ġandroid . view . LayoutInflater Ċ import Ġandroid . view . View Ċ import Ġandroid . view . ViewGroup Ċ import Ġco il . Image Loader Ċ import Ġco il . load Ċ import Ġcom . google . android . material . bottom sheet . Bottom Sheet Behavior Ċ import Ġio . nova foundation . nova . common . base . Base Fragment Ċ import Ġio . nova foundation . nova . common . di . Feature Utils Ċ import Ġio . nova foundation . nova . common . utils . apply Bar Margin Ċ import Ġio . nova foundation . nova . common . utils . hide Keyboard Ċ import Ġio . nova foundation . nova . common . utils . setTextColor Res Ċ import Ġio . nova foundation . nova . feature _ assets . R Ċ import Ġio . nova foundation . nova . feature _ assets . di . Assets Feature Api Ċ import Ġio . nova foundation . nova . feature _ assets . di . Assets Feature Component Ċ import Ġio . nova foundation . nova . feature _ assets . presentation . Asset Payload Ċ import Ġio . nova foundation . nova . feature _ assets . presentation . balance . asset Actions . buy . setup Buy Integration Ċ import Ġio . nova foundation . nova . feature _ assets . presentation . model . Asset Model Ċ import Ġio . nova foundation . nova . feature _ assets . presentation . transaction . history . show State Ċ import Ġio . nova foundation . nova . feature _ wallet _ api . presentation . view . show Amount Ċ import Ġkotlinx . android . synt hetic . main . fragment _ balance _ detail . balance Det ai Actions Ċ import Ġkotlinx . android . synt hetic . main . fragment _ balance _ detail . balance Detail Back Ċ import Ġkotlinx . android . synt hetic . main . fragment _ balance _ detail . balance Detail Container Ċ import Ġkotlinx . android . synt hetic . main . fragment _ balance _ detail . balance Detail Content Ċ import Ġkotlinx . android . synt hetic . main . fragment _ balance _ detail . balance Detail Rate Ċ import Ġkotlinx . android . synt hetic . main . fragment _ balance _ detail . balance Detail Rate Change Ċ import Ġkotlinx . android . synt hetic . main . fragment _ balance _ detail . balance Detail Token Icon Ċ import Ġkotlinx . android . synt hetic . main . fragment _ balance _ detail . balance Detail Token Name Ċ import Ġkotlinx . android . synt hetic . main . fragment _ balance _ detail . balance Details Balances Ċ import Ġkotlinx . android . synt hetic . main . fragment _ balance _ detail . trans fers Container Ċ import Ġjavax . inject . Inject Ċ Ċ private Ġconst Ġval ĠKEY _ TOKEN Ġ= Ġ" KEY _ TOKEN " Ċ Ċ class ĠBalance Detail Fragment Ġ: ĠBase Fragment < Balance Detail ViewModel >() Ġ{ ĊĊĠĠĠ Ġcompanion Ġobject Ġ{ ĊĊĠĠĠĠĠĠĠ Ġfun Ġget Bundle ( asset Payload : ĠAsset Payload ): ĠBundle Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġreturn ĠBundle (). apply Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġput Parcelable ( KEY _ TOKEN , Ġasset Payload ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Inject Ġlateinit Ġvar Ġimage Loader : ĠImage Loader ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate View ( ĊĠĠĠĠĠĠĠ Ġinflater : ĠLayoutInflater , ĊĠĠĠĠĠĠĠ Ġcontainer : ĠViewGroup ?, ĊĠĠĠĠĠĠĠ ĠsavedInstanceState : ĠBundle ?, ĊĠĠĠ Ġ): ĠView ? Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġinflater . inflate ( R . layout . fragment _ balance _ detail , Ġcontainer , Ġfalse ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġinit Views () Ġ{ ĊĠĠĠĠĠĠĠ Ġhide Keyboard () ĊĊĠĠĠĠĠĠĠ Ġbalance Detail Back . apply Bar Margin () ĊĠĠĠĠĠĠĠ Ġbalance Detail Token Name . apply Bar Margin () ĊĊĠĠĠĠĠĠĠ Ġtransfers Container . initialize Behavior ( anchor View Ġ= Ġbalance Detail Content ) ĊĊĠĠĠĠĠĠĠ Ġtransfers Container . set Scrolling Listener ( viewModel :: transactions Sc rolled ) ĊĊĠĠĠĠĠĠĠ Ġtransfers Container . set Sl iding State Listener (:: set Refresh Enabled ) ĊĊĠĠĠĠĠĠĠ Ġtransfers Container . set Transaction ClickListener ( viewModel :: transaction Clicked ) ĊĊĠĠĠĠĠĠĠ Ġtransfers Container . set Filter ClickListener Ġ{ ĠviewModel . filter Clicked () Ġ} ĊĊĠĠĠĠĠĠĠ Ġbalance Detail Container . setOn Refresh Listener Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠviewModel . sync () ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġbalance Detail Back . setOnClickListener Ġ{ ĠviewModel . back Clicked () Ġ} ĊĊĠĠĠĠĠĠĠ Ġbalance Det ai Actions . send . setOnClickListener Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠviewModel . send Clicked () ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġbalance Det ai Actions . receive . setOnClickListener Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠviewModel . receive Clicked () ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġbalance Details Balances . locked . setOnClickListener Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠviewModel . locked Info Clicked () ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġinject () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġtoken Ġ= Ġarguments ! ![ KEY _ TOKEN ] Ġas ĠAsset Payload ĊĊĠĠĠĠĠĠĠ ĠFeature Utils . get Feature < Assets Feature Component >( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġrequire Context (), ĊĠĠĠĠĠĠĠĠĠĠĠ ĠAssets Feature Api :: class . java ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. balance Detail Component Factory () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. create ( this , Ġtoken ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. inject ( this ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġsubscribe ( viewModel : ĠBalance Detail ViewModel ) Ġ{ ĊĠĠĠĠĠĠĠ ĠviewModel . sync () ĊĊĠĠĠĠĠĠĠ ĠviewModel . state . observe ( trans fers Container :: show State ) ĊĊĠĠĠĠĠĠĠ Ġsetup Buy Integration ( viewModel . buy Mixin , Ġbuy Button Ġ= Ġbalance Det ai Actions . buy ) ĊĊĠĠĠĠĠĠĠ ĠviewModel . asset Details Model . observe Ġ{ Ġasset Ġ-> ĊĠĠĠĠĠĠĠĠĠĠĠ Ġbalance Detail Token Icon . load ( asset . token . configuration . icon Url , Ġimage Loader ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġbalance Detail Token Name . text Ġ= Ġasset . token . configuration . symbol ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġbalance Detail Rate . text Ġ= Ġasset . token . d ollar Rate ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġbalance Detail Rate Change . setTextColor Res ( asset . token . rate Change Color Res ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġbalance Detail Rate Change . text Ġ= Ġasset . token . recent Rate Change ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġbalance Details Balances . total . show Amount ( asset . total ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġbalance Details Balances . transfer able . show Amount ( asset . transfer able ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġbalance Details Balances . locked . show Amount ( asset . locked ) ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ ĠviewModel . hide Refresh Event . observe Event Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġbalance Detail Container . is Refresh ing Ġ= Ġfalse ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ ĠviewModel . show Frozen Details Event . observe Event (:: show Locked Details ) ĊĊĠĠĠĠĠĠĠ ĠviewModel . send Enabled . observe ( balance Det ai Actions . send :: setEnabled ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġset Refresh Enabled ( bottom Sheet State : ĠInt ) Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġbottom Sheet Collapsed Ġ= ĠBottom Sheet Behavior . STATE _ COLL AP SED Ġ== Ġbottom Sheet State ĊĠĠĠĠĠĠĠ Ġbalance Detail Container . isEnabled Ġ= Ġbottom Sheet Collapsed ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġshow Locked Details ( model : ĠAsset Model ) Ġ{ ĊĠĠĠĠĠĠĠ ĠLocked Tokens Bottom Sheet ( require Context (), Ġmodel ). show () ĊĠĠĠ Ġ} Ċ } Ċ