package Ġcom . str atag ile . q link . ui . activity . mining Ċ Ċ import Ġandroid . app . Activity Ċ import Ġandroid . content . Intent Ċ import Ġandroid . os . Bundle Ċ import Ġcom . str atag ile . q link . R Ċ Ċ import Ġcom . str atag ile . q link . application . AppConfig Ċ import Ġcom . str atag ile . q link . base . Base Activity Ċ import Ġcom . str atag ile . q link . constant . Constant Value Ċ import Ġcom . str atag ile . q link . entity . event bus . Change View pager Ċ import Ġcom . str atag ile . q link . entity . mining . Min ing Index Ċ import Ġcom . str atag ile . q link . entity . mining . Min ing Rank Ċ import Ġcom . str atag ile . q link . ui . activity . main . WebView Activity Ċ import Ġcom . str atag ile . q link . ui . activity . mining . component . D agger Min ing Invite Component Ċ import Ġcom . str atag ile . q link . ui . activity . mining . contract . Min ing Invite Contract Ċ import Ġcom . str atag ile . q link . ui . activity . mining . module . Min ing Invite Module Ċ import Ġcom . str atag ile . q link . ui . activity . mining . presenter . Min ing Invite Presenter Ċ import Ġcom . str atag ile . q link . ui . activity . reward . Claim Reward Activity Ċ import Ġcom . str atag ile . q link . ui . adapter . mining . Min ing Rank Adapter Ċ import Ġcom . str atag ile . q link . utils . Account Util Ċ import Ġcom . str atag ile . q link . utils . Fire Base Utils Ċ import Ġkotlinx . android . synt hetic . main . activity _ mining _ invite .* Ċ import Ġkotlinx . android . synt hetic . main . activity _ mining _ invite . re cyclerView Ċ import Ġorg . green robot . event bus . EventBus Ċ import Ġjava . math . BigDecimal Ċ Ċ import Ġjavax . inject . Inject ; Ċ Ċ /** Ċ Ġ* Ġ@ author Ġh zp Ċ Ġ* Ġ@ Package Ġcom . str atag ile . q link . ui . activity . mining Ċ Ġ* Ġ@ Description : Ġ$ description Ċ Ġ* Ġ@ date Ġ 2 0 1 9 / 1 1 / 1 4 Ġ 0 9 : 4 3 : 0 6 Ċ Ġ*/ Ċ Ċ class ĠMin ing Invite Activity Ġ: ĠBase Activity (), ĠMin ing Invite Contract . View Ġ{ ĊĠĠĠ Ġoverride Ġfun Ġset Reward Rank ( mining Rank : ĠMin ing Index ) Ġ{ ĊĠĠĠĠĠĠĠ Ġcan Claim Count Ġ= Ġmining Rank . no A ward Total . to BigDecimal (). strip Trailing Z eros (). to Plain String () ĊĠĠĠĠĠĠĠ Ġtv Can Claim Q G AS . text Ġ= Ġmining Rank . no A ward Total . to BigDecimal (). strip Trailing Z eros (). to Plain String () ĊĠĠĠĠĠĠĠ Ġtv Cl a imed Q gas . text Ġ= ĠgetString ( R . string . i _ have _ claimed _ ql c , Ġmining Rank . aw arded Total . to BigDecimal (). strip Trailing Z eros (). to Plain String ()) ĊĠĠĠĠĠĠĠ Ġtv Invite Count . text Ġ= ĠgetString ( R . string ._ 3 0 0 0 _ q gas _ tr aded , Ġmining Rank . total Finish . to BigDecimal (). strip Trailing Z eros (). to Plain String ()) ĊĠĠĠĠĠĠĠ Ġtv Act Q lc Amount . text Ġ= Ġmining Rank . total Reward Amount . to BigDecimal (). strip Trailing Z eros (). to Plain String () Ġ+ Ġ" ĠQ LC " ĊĊĠĠĠĠĠĠĠ Ġval Ġmining Rank Adapter Ġ= ĠMin ing Rank Adapter ( mining Rank . reward Rank ings ) ĊĠĠĠĠĠĠĠ Ġre cyclerView . adapter Ġ= Ġmining Rank Adapter ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Inject ĊĠĠĠ Ġinternal Ġlateinit Ġvar Ġm Presenter : ĠMin ing Invite Presenter ĊĊĠĠĠ Ġvar Ġcan Claim Count Ġ= Ġ"" ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate ( savedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġmain Color Ġ= ĠR . color . white ĊĠĠĠĠĠĠĠ Ġsuper . onCreate ( savedInstanceState ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġinit View () Ġ{ ĊĠĠĠĠĠĠĠ ĠsetContentView ( R . layout . activity _ mining _ invite ) ĊĠĠĠĠĠĠĠ Ġre cyclerView . set Has Fixed Size ( true ) ĊĠĠĠĠĠĠĠ Ġre cyclerView . is Nested Scrolling Enabled Ġ= Ġfalse ĊĠĠĠĠĠĠĠ Ġmining Explain . setOnClickListener Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġintent Ġ= ĠIntent ( this , ĠWebView Activity :: class . java ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġintent . putExtra (" url ", Ġ" https :// medium . com /@ QL C _ team / q gas - buy back - campaign - kick ing - off - in - q - wallet - ot c - join - to - trade - q gas - for - ql c - rewards - 3 9 c 7 2 4 1 e 7 2 d 4 ") ĊĠĠĠĠĠĠĠĠĠĠĠ Ġintent . putExtra (" title ", Ġ" QL C ") ĊĠĠĠĠĠĠĠĠĠĠĠ ĠstartActivity ( intent ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġtv Can Claim Q G AS . text Ġ= Ġ" 0 " ĊĠĠĠĠĠĠĠ Ġtv Cl a imed Q gas . text Ġ= ĠgetString ( R . string . i _ have _ claimed _ ql c , Ġ" 0 ") ĊĠĠĠĠĠĠĠ Ġtv Invite Count . text Ġ= ĠgetString ( R . string ._ 3 0 0 0 _ q gas _ tr aded , Ġ" 0 ") ĊĠĠĠĠĠĠĠ Ġtv Act Q lc Amount . text Ġ= Ġ" 0 " Ġ+ Ġ" ĠQ LC " ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġinit Data () Ġ{ ĊĠĠĠĠĠĠĠ Ġtitle . text Ġ= ĠgetString ( R . string . sheet _ min ig ) ĊĠĠĠĠĠĠĠ ĠFire Base Utils . log Event ( this , ĠFire Base Utils . event Trades Min ing ) ĊĠĠĠĠĠĠĠ Ġtv Reward Detail . setOnClickListener Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠstartActivity For Result ( Intent ( this , ĠMin ing Daily Detail Activity :: class . java ), Ġ 2 ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġtv Trade Now . setOnClickListener Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠFire Base Utils . log Event ( this , ĠFire Base Utils . event Trade Now ) ĊĠĠĠĠĠĠĠĠĠĠĠ ĠEvent Bus . getDefault (). post ( Change View pager ( 1 )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġfinish () ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġget Min ing Rank () ĊĠĠĠĠĠĠĠ Ġtv Claim Now . setOnClickListener Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠFire Base Utils . log Event ( this , ĠFire Base Utils . event Claim QL C ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġif Ġ(! "" . equals ( can Claim Count ) Ġ|| Ġcan Claim Count . to BigDecimal () Ġ> ĠBigDecimal . ZERO ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġclaim Intent Ġ= ĠIntent ( this , ĠMin ing Reward Activity :: class . java ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġclaim Intent . putExtra (" total ", Ġcan Claim Count ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġclaim Intent . putExtra (" claim Type ", Ġ" invite ") ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠstartActivity For Result ( claim Intent , Ġ 1 ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Activity Result ( request Code : ĠInt , ĠresultCode : ĠInt , Ġdata : ĠIntent ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . on Activity Result ( request Code , ĠresultCode , Ġdata ) ĊĠĠĠĠĠĠĠ Ġif Ġ( request Code Ġ== Ġ 1 Ġ&& ĠresultCode Ġ== ĠActivity . RESULT _ OK ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġget Min ing Rank () ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġif Ġ( request Code Ġ== Ġ 2 Ġ&& ĠresultCode Ġ== ĠActivity . RESULT _ OK ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠEvent Bus . getDefault (). post ( Change View pager ( 1 )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġfinish () ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġsetup Activity Component () Ġ{ ĊĠĠĠĠĠĠĠ ĠD agger Min ing Invite Component ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. builder () ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. app Component (( application Ġas ĠApp Config ). application Component ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. mining Invite Module ( Min ing Invite Module ( this )) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. build () ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ. inject ( this ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġset Presenter ( presenter : ĠMin ing Invite Contract . Min ing Invite Contract Presenter ) Ġ{ ĊĠĠĠĠĠĠĠ Ġm Presenter Ġ= Ġpresenter Ġas ĠMin ing Invite Presenter ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġshow Progress Dialog () Ġ{ ĊĠĠĠĠĠĠĠ Ġprogress Dialog . show () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġclose Progress Dialog () Ġ{ ĊĠĠĠĠĠĠĠ Ġprogress Dialog . hide () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġget Min ing Rank () Ġ{ ĊĠĠĠĠĠĠĠ Ġvar Ġmap Ġ= Ġhash Map Of < String , ĠString >() ĊĠĠĠĠĠĠĠ Ġmap [" account "] Ġ= ĠConstant Value . currentUser . account ĊĠĠĠĠĠĠĠ Ġmap [" token "] Ġ= ĠAccount Util . getUser Token () ĊĠĠĠĠĠĠĠ Ġm Presenter . getMin ing Reward List ( map ) ĊĠĠĠ Ġ} Ċ Ċ }