package Ġjp . co . sor am its u . feature _ c rowd loan _ impl . presentation . contribute . confirm Ċ Ċ import Ġandroid . os . Bundle Ċ import Ġandroid . view . LayoutInflater Ċ import Ġandroid . view . View Ċ import Ġandroid . view . ViewGroup Ċ import Ġco il . Image Loader Ċ import Ġdev . chr is ban es . in setter . apply In setter Ċ import Ġjp . co . sor am its u . common . base . Base Fragment Ċ import Ġjp . co . sor am its u . common . di . Feature Utils Ċ import Ġjp . co . sor am its u . common . mixin . impl . observe Browser Events Ċ import Ġjp . co . sor am its u . common . mixin . impl . observe Valid ations Ċ import Ġjp . co . sor am its u . common . utils . setVisible Ċ import Ġjp . co . sor am its u . common . view . set Progress Ċ import Ġjp . co . sor am its u . feature _ account _ api . pres en at ation . actions . setup External Actions Ċ import Ġjp . co . sor am its u . feature _ c rowd loan _ api . di . C rowd loan Feature Api Ċ import Ġjp . co . sor am its u . feature _ c rowd loan _ impl . R Ċ import Ġjp . co . sor am its u . feature _ c rowd loan _ impl . di . C rowd loan Feature Component Ċ import Ġjp . co . sor am its u . feature _ c rowd loan _ impl . presentation . contribute . confirm . parcel . Confirm Contribut e Payload Ċ import Ġjp . co . sor am its u . feature _ wallet _ api . presentation . mixin . observe Transfer Checks Ċ import Ġkotlinx . android . synt hetic . main . fragment _ contribute _ confirm . confirm Contribut e Amount Ċ import Ġkotlinx . android . synt hetic . main . fragment _ contribute _ confirm . confirm Contribut e Bonus Ċ import Ġkotlinx . android . synt hetic . main . fragment _ contribute _ confirm . confirm Contribut e Confirm Ċ import Ġkotlinx . android . synt hetic . main . fragment _ contribute _ confirm . confirm Contribut e Container Ċ import Ġkotlinx . android . synt hetic . main . fragment _ contribute _ confirm . confirm Contribut e C row loan Title Ċ import Ġkotlinx . android . synt hetic . main . fragment _ contribute _ confirm . confirm Contribut e Fee Ċ import Ġkotlinx . android . synt hetic . main . fragment _ contribute _ confirm . confirm Contribut e Le asing Period Ċ import Ġkotlinx . android . synt hetic . main . fragment _ contribute _ confirm . confirm Contribut e Origin A count Ċ import Ġkotlinx . android . synt hetic . main . fragment _ contribute _ confirm . confirm Contribut e Reward Ċ import Ġkotlinx . android . synt hetic . main . fragment _ contribute _ confirm . confirm Contribut e Toolbar Ċ import Ġkotlinx . android . synt hetic . main . fragment _ contribute _ confirm . moon beam Ether ium Address Text Ċ import Ġkotlinx . android . synt hetic . main . fragment _ contribute _ confirm . moon beam Ether ium Address Title Ċ import Ġjava . math . BigDecimal Ċ import Ġjavax . inject . Inject Ċ Ċ private Ġconst Ġval ĠKEY _ PAYLOAD Ġ= Ġ" KEY _ PAYLOAD " Ċ Ċ class ĠConfirm Contribut e Fragment Ġ: ĠBase Fragment < Confirm Contribut e ViewModel >() Ġ{ ĊĊĠĠĠ Ġ@ Inject Ġprotected Ġlateinit Ġvar Ġimage Loader : ĠImage Loader ĊĊĠĠĠ Ġcompanion Ġobject Ġ{ ĊĊĠĠĠĠĠĠĠ Ġfun Ġget Bundle ( payload : ĠConfirm Contribut e Payload ) Ġ= ĠBundle (). apply Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġput Parcelable ( KEY _ PAYLOAD , Ġpayload ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate View ( ĊĠĠĠĠĠĠĠ Ġinflater : ĠLayoutInflater , ĊĠĠĠĠĠĠĠ Ġcontainer : ĠViewGroup ?, ĊĠĠĠĠĠĠĠ ĠsavedInstanceState : ĠBundle ?, ĊĠĠĠ Ġ): ĠView ? Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġinflater . inflate ( R . layout . fragment _ contribute _ confirm , Ġcontainer , Ġfalse ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġinit Views () Ġ{ ĊĠĠĠĠĠĠĠ Ġconfirm Contribut e Container . apply In setter Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġtype ( status Bars Ġ= Ġtrue ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġpadding () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġconsume ( true ) ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġconfirm Contribut e Toolbar . set Home Button Listener Ġ{ ĠviewModel . back Clicked () Ġ} ĊĠĠĠĠĠĠĠ Ġconfirm Contribut e Confirm . prepare For Progress ( view Lifecycle Owner ) ĊĠĠĠĠĠĠĠ Ġconfirm Contribut e Confirm . setOnClickListener Ġ{ ĠviewModel . next Clicked () Ġ} ĊĊĠĠĠĠĠĠĠ Ġconfirm Contribut e Origin A count . set Whole ClickListener Ġ{ ĠviewModel . origin Account Clicked () Ġ} ĊĠĠĠĠĠĠĠ Ġconfirm Contribut e Bonus ?. setOnClickListener Ġ{ ĠviewModel . bonus Clicked () Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġinject () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġpayload Ġ= Ġargument < Confirm Contribut e Payload >( KEY _ PAYLOAD ) ĊĊĠĠĠĠĠĠĠ ĠFeature Utils . get Feature < C rowd loan Feature Component >( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġrequire Context (), ĊĠĠĠĠĠĠĠĠĠĠĠ ĠC rowd loan Feature Api :: class . java ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. confirm Contribut e Factory () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. create ( this , Ġpayload ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. inject ( this ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġsubscribe ( viewModel : ĠConfirm Contribut e ViewModel ) Ġ{ ĊĠĠĠĠĠĠĠ Ġobserve Browser Events ( viewModel ) ĊĠĠĠĠĠĠĠ Ġobserve Valid ations ( viewModel ) ĊĠĠĠĠĠĠĠ Ġsetup External Actions ( viewModel ) ĊĠĠĠĠĠĠĠ Ġobserve Transfer Checks ( viewModel , ĠviewModel :: warning Confirmed ) ĊĊĠĠĠĠĠĠĠ ĠviewModel . show Next Progress . observe ( confirm Contribut e Confirm :: set Progress ) ĊĊĠĠĠĠĠĠĠ ĠviewModel . asset Model Flow . observe Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġconfirm Contribut e Amount . set Asset Balance ( it . asset Balance ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġconfirm Contribut e Amount . set Asset Name ( it . token Name ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġconfirm Contribut e Amount . set Asset ImageUrl ( it . imageUrl , Ġimage Loader ) ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġconfirm Contribut e Amount . amount Input . setText ( viewModel . selected Amount ) ĊĊĠĠĠĠĠĠĠ ĠviewModel . enter ed Fi at Amount Flow . observe Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġit ?. let ( confirm Contribut e Amount :: set Asset Balance Dollar Amount ) ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ ĠviewModel . fee Flow . observe ( confirm Contribut e Fee :: set Fee Status ) ĊĊĠĠĠĠĠĠĠ Ġwith ( confirm Contribut e Reward ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġreward Ġ= ĠviewModel . estimated Reward ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġset Visible ( reward Ġ!= Ġnull ) ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġreward ?. let Ġ{ Ġshow Value ( it ) Ġ} ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ ĠviewModel . c rowd loan Info Flow . observe Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġconfirm Contribut e Le asing Period . show Value ( ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġprimary Ġ= Ġit . lease Period , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġsecondary Ġ= ĠgetString ( R . string . till _ format , Ġit . lease d Until ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ ĠviewModel . selected Address Model Flow . observe Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġconfirm Contribut e Origin A count . setMessage ( it . name Or Address ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġconfirm Contribut e Origin A count . setText Icon ( it . image ) ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ ĠviewModel . bonus Flow . observe Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġis Moon beam Ġ= Ġargument < Confirm Contribut e Payload >( KEY _ PAYLOAD ). metadata ?. is Moon beam Ġ== Ġtrue ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġis A star Ġ= Ġargument < Confirm Contribut e Payload >( KEY _ PAYLOAD ). metadata ?. is A star Ġ== Ġtrue ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġis Inter lay Ġ= Ġargument < Confirm Contribut e Payload >( KEY _ PAYLOAD ). metadata ?. is Inter lay Ġ== Ġtrue ĊĠĠĠĠĠĠĠĠĠĠĠ Ġconfirm Contribut e Bonus ?. setVisible ( it Ġ!= Ġnull Ġ&& Ġ! is Moon beam Ġ&& Ġ! is A star Ġ&& Ġ! is Inter lay ) ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġit ?. let Ġ{ Ġconfirm Contribut e Bonus ?. show Value ( it ) Ġ} ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ ĠviewModel . bonus Number Flow . observe Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġconfirm Contribut e Bonus ?. setValue Color Res ( getColor ( it )) ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ ĠviewModel . eth Address . let Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġmoon beam Ether ium Address Text . setVisible ( it Ġ!= Ġnull ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġmoon beam Ether ium Address Title . setVisible ( it Ġ!= Ġnull ) ĊĊĠĠĠĠĠĠĠĠĠĠĠ Ġmoon beam Ether ium Address Text . text Ġ= Ġit ?. first . or Empty () ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġconfirm Contribut e C row loan Title . text Ġ= ĠviewModel . title ĊĠĠĠĠĠĠĠ Ġapply Custom Bonus () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġapply Custom Bonus () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġis Apply Ġ= Ġ( argument < Confirm Contribut e Payload >( KEY _ PAYLOAD ). metadata )?. run Ġ{ Ġis A cal a Ġ|| Ġis Inter lay Ġ} Ġ?: Ġfalse ĊĠĠĠĠĠĠĠ Ġif Ġ( is Apply ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġconfirm Contribut e Bonus ?. setVisible ( true ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġconfirm Contribut e Bonus ?. show Value ( getString ( R . string . label _ link )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġconfirm Contribut e Bonus ?. setValue Color Res ( R . color . color Accent ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġget Color ( bonus : ĠBigDecimal ?) Ġ= Ġwhen Ġ{ ĊĠĠĠĠĠĠĠ Ġbonus Ġ== Ġnull Ġ|| Ġbonus Ġ<= ĠBigDecimal . ZERO Ġ-> ĠR . color . white ĊĠĠĠĠĠĠĠ Ġelse Ġ-> ĠR . color . color Accent ĊĠĠĠ Ġ} Ċ } Ċ