/** Ċ Ġ* ĠCopyright Ġ 2 0 2 0 ĠThe ĠT ari ĠProject Ċ Ġ* Ċ Ġ* ĠRedistribution Ġand Ġuse Ġin Ġsource Ġand Ġbinary Ġforms , Ġwith Ġor Ċ Ġ* Ġwithout Ġmodification , Ġare Ġpermitted Ġprovided Ġthat Ġthe Ċ Ġ* Ġfollowing Ġconditions Ġare Ġmet : Ċ Ġ* Ċ Ġ* Ġ 1 . ĠRedistributions Ġof Ġsource Ġcode Ġmust Ġretain Ġthe Ġabove Ġcopyright Ġnotice , Ċ Ġ* Ġthis Ġlist Ġof Ġconditions Ġand Ġthe Ġfollowing Ġdisclaimer . Ċ Ġ* Ċ Ġ* Ġ 2 . ĠRedistributions Ġin Ġbinary Ġform Ġmust Ġreproduce Ġthe Ġabove Ċ Ġ* Ġcopyright Ġnotice , Ġthis Ġlist Ġof Ġconditions Ġand Ġthe Ġfollowing Ġdisclaimer Ġin Ġthe Ċ Ġ* Ġdocumentation Ġand / or Ġother Ġmaterials Ġprovided Ġwith Ġthe Ġdistribution . Ċ Ġ* Ċ Ġ* Ġ 3 . ĠNeither Ġthe Ġname Ġof Ġthe Ġcopyright Ġholder Ġnor Ġthe Ġnames Ġof Ċ Ġ* Ġits Ġcontributors Ġmay Ġbe Ġused Ġto Ġendorse Ġor Ġpromote Ġproducts Ċ Ġ* Ġderived Ġfrom Ġthis Ġsoftware Ġwithout Ġspecific Ġprior Ġwritten Ġpermission . Ċ Ġ* Ċ Ġ* ĠTHIS ĠSOFTWARE ĠIS ĠPROVIDED ĠBY ĠTHE ĠCOPYRIGHT ĠHOLDERS ĠAND Ċ Ġ* ĠCONTRIBUTORS Ġ" AS ĠIS " ĠAND ĠANY ĠEXPRESS ĠOR ĠIMPLIED ĠWARRANTIES , Ċ Ġ* ĠINCLUDING , ĠBUT ĠNOT ĠLIMITED ĠTO , ĠTHE ĠIMPLIED ĠWARRANTIES Ċ Ġ* ĠOF ĠMERCHANTABILITY ĠAND ĠFITNESS ĠFOR ĠA ĠPARTICULAR ĠPURPOSE ĠARE Ċ Ġ* ĠDISCLAIMED . ĠIN ĠNO ĠEVENT ĠSHALL ĠTHE ĠCOPYRIGHT ĠHOLDER ĠOR Ċ Ġ* ĠCONTRIBUTORS ĠBE ĠLIABLE ĠFOR ĠANY ĠDIRECT , ĠINDIRECT , ĠINCIDENTAL , Ċ Ġ* ĠSPECIAL , ĠEXEMPLARY , ĠOR ĠCONSEQUENTIAL ĠDAMAGES Ġ( INCLUDING , ĠBUT Ċ Ġ* ĠNOT ĠLIMITED ĠTO , ĠPROCUREMENT ĠOF ĠSUBSTITUTE ĠGOODS ĠOR ĠSERVICES ; Ċ Ġ* ĠLOSS ĠOF ĠUSE , ĠDATA , ĠOR ĠPROFITS ; ĠOR ĠBUSINESS ĠINTERRUPTION ) Ċ Ġ* ĠHOWEVER ĠCAUSED ĠAND ĠON ĠANY ĠTHEORY ĠOF ĠLIABILITY , ĠWHETHER ĠIN Ċ Ġ* ĠCONTRACT , ĠSTRICT ĠLIABILITY , ĠOR ĠTORT Ġ( INCLUDING ĠNEGLIGENCE Ċ Ġ* ĠOR ĠOTHERWISE ) ĠARISING ĠIN ĠANY ĠWAY ĠOUT ĠOF ĠTHE ĠUSE ĠOF ĠTHIS Ċ Ġ* ĠSOFTWARE , ĠEVEN ĠIF ĠADVISED ĠOF ĠTHE ĠPOSSIBILITY ĠOF ĠSUCH ĠDAMAGE . Ċ Ġ*/ Ċ package Ġcom . t ari . android . wallet . ui . fragment . restore . choose Restore Option Ċ Ċ import Ġandroid . content . Context Ċ import Ġandroid . content . Intent Ċ import Ġandroid . os . Bundle Ċ import Ġandroid . view . LayoutInflater Ċ import Ġandroid . view . View Ċ import Ġandroid . view . ViewGroup Ċ import Ġandroidx . fragment . app . view Models Ċ import Ġcom . t ari . android . wallet . R . color . all _ settings _ back _ up _ status _ processing Ċ import Ġcom . t ari . android . wallet . databinding . Fragment Choose Restore Option Binding Ċ import Ġcom . t ari . android . wallet . di . Di Container . app Component Ċ import Ġcom . t ari . android . wallet . extension . observe Ċ import Ġcom . t ari . android . wallet . infrastructure . backup . Backup Manager Ċ import Ġcom . t ari . android . wallet . ui . activity . restore . Wallet Restore Router Ċ import Ġcom . t ari . android . wallet . ui . common . Common Fragment Ċ import Ġcom . t ari . android . wallet . ui . extension .* Ċ import Ġjavax . inject . Inject Ċ Ċ internal Ġclass ĠChoose Restore Option Fragment Ġ: ĠCommon Fragment < Fragment Choose Restore Option Binding , ĠChoose Restore Option ViewModel >() Ġ{ ĊĊĠĠĠ Ġ@ Inject ĊĠĠĠ Ġinternal Ġlateinit Ġvar Ġbackup Manager : ĠBackup Manager ĊĊĠĠĠ Ġoverride Ġfun Ġon Attach ( context : ĠContext ) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . on Attach ( context ) ĊĠĠĠĠĠĠĠ Ġapp Component . inject ( this ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Activity Result ( request Code : ĠInt , ĠresultCode : ĠInt , Ġdata : ĠIntent ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . on Activity Result ( request Code , ĠresultCode , Ġdata ) ĊĠĠĠĠĠĠĠ ĠviewModel . on Activity Result ( request Code , ĠresultCode , Ġdata ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate View ( ĊĠĠĠĠĠĠĠ Ġinflater : ĠLayoutInflater , ĊĠĠĠĠĠĠĠ Ġcontainer : ĠViewGroup ?, ĊĠĠĠĠĠĠĠ ĠsavedInstanceState : ĠBundle ? ĊĠĠĠ Ġ): ĠView Ġ= ĊĠĠĠĠĠĠĠ ĠFragment Choose Restore Option Binding . inflate ( in flater , Ġcontainer , Ġfalse ). also Ġ{ Ġui Ġ= Ġit Ġ}. root ĊĊĠĠĠ Ġoverride Ġfun Ġon View Created ( view : ĠView , ĠsavedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . on View Created ( view , ĠsavedInstanceState ) ĊĊĠĠĠĠĠĠĠ Ġval ĠviewModel : ĠChoose Restore Option ViewModel Ġby Ġview Models () ĊĠĠĠĠĠĠĠ Ġbind ViewModel ( viewModel ) ĊĊĠĠĠĠĠĠĠ Ġsetup UI () ĊĊĠĠĠĠĠĠĠ Ġobserve UI () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġsetup UI () Ġ= Ġwith ( ui ) Ġ{ ĊĠĠĠĠĠĠĠ Ġback C ta View . setOn Th rott led ClickListener Ġ{ Ġrequire Activity (). on Back Pressed () Ġ} ĊĠĠĠĠĠĠĠ Ġrestore Wallet MenuItem Progress View . setColor ( color ( all _ settings _ back _ up _ status _ processing )) ĊĠĠĠĠĠĠĠ Ġrestore Wallet MenuItem Progress View . g one () ĊĠĠĠĠĠĠĠ Ġrestore Wallet C ta View . setOn Th rott led ClickListener Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġprocess State ( Choose Restore Option State . Begin Progress ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġbackup Manager . setup Storage ( this @ Choose Restore Option Fragment ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġrestore With Recovery Phrase C ta View . setOn Th rott led ClickListener Ġ{ Ġprocess Navigation ( Choose Restore Option Navigation . To Restore With Recovery Phrase ) Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġobserve UI () Ġ= Ġwith ( viewModel ) Ġ{ ĊĠĠĠĠĠĠĠ Ġobserve ( state ) Ġ{ Ġprocess State ( it ) Ġ} ĊĊĠĠĠĠĠĠĠ Ġobserve ( navigation ) Ġ{ Ġprocess Navigation ( it ) Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġprocess State ( state : ĠChoose Restore Option State ) Ġ{ ĊĠĠĠĠĠĠĠ Ġwhen Ġ( state ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠChoose Restore Option State . Begin Progress Ġ-> Ġbegin Progress () ĊĠĠĠĠĠĠĠĠĠĠĠ ĠChoose Restore Option State . End Progress Ġ-> Ġend Progress () ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġprocess Navigation ( navigation : ĠChoose Restore Option Navigation ) Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġrouter Ġ= Ġrequire Activity () Ġas ĠWallet Restore Router ĊĠĠĠĠĠĠĠ Ġwhen Ġ( navigation ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠChoose Restore Option Navigation . To Restore InProgress Ġ-> Ġrouter . to Restore InProgress () ĊĠĠĠĠĠĠĠĠĠĠĠ ĠChoose Restore Option Navigation . To Enter Restore Password Ġ-> Ġrouter . to Enter Restore Password () ĊĠĠĠĠĠĠĠĠĠĠĠ ĠChoose Restore Option Navigation . On Restore Completed Ġ-> Ġrouter . on Restore Completed () ĊĠĠĠĠĠĠĠĠĠĠĠ ĠChoose Restore Option Navigation . To Restore With Recovery Phrase Ġ-> Ġrouter . to Restore With Recovery Phrase () ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġbegin Progress () Ġ= Ġwith ( ui ) Ġ{ ĊĠĠĠĠĠĠĠ Ġblocking Back Press Dispatcher . isEnabled Ġ= Ġtrue ĊĠĠĠĠĠĠĠ Ġrestore Wallet MenuItem Progress View . visible () ĊĠĠĠĠĠĠĠ Ġrestore Wallet MenuItem Arrow ImageView . invisible () ĊĠĠĠĠĠĠĠ Ġrestore Wallet C ta View . isEnabled Ġ= Ġfalse ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġend Progress () Ġ= Ġwith ( ui ) Ġ{ ĊĠĠĠĠĠĠĠ Ġblocking Back Press Dispatcher . isEnabled Ġ= Ġfalse ĊĠĠĠĠĠĠĠ Ġrestore Wallet MenuItem Progress View . invisible () ĊĠĠĠĠĠĠĠ Ġrestore Wallet MenuItem Arrow ImageView . visible () ĊĠĠĠĠĠĠĠ Ġrestore Wallet C ta View . isEnabled Ġ= Ġtrue ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġcompanion Ġobject Ġ{ ĊĠĠĠĠĠĠĠ Ġfun Ġnew Instance () Ġ= ĠChoose Restore Option Fragment () ĊĠĠĠ Ġ} Ċ } ĊĊ