package Ġorg . opp ia . android . app . administrator controls Ċ Ċ import Ġandroid . view . LayoutInflater Ċ import Ġandroid . view . View Ċ import Ġandroid . view . ViewGroup Ċ import Ġandroidx . appcompat . app . AppCompatActivity Ċ import Ġandroidx . fragment . app . Fragment Ċ import Ġandroidx . recyclerview . widget . Linear LayoutManager Ċ import Ġorg . opp ia . android . app . administrator controls . administrator controls item view model . Administrator Controls Account Actions ViewModel Ċ import Ġorg . opp ia . android . app . administrator controls . administrator controls item view model . Administrator Controls App Information ViewModel Ċ import Ġorg . opp ia . android . app . administrator controls . administrator controls item view model . Administrator Controls Download Permissions ViewModel Ċ import Ġorg . opp ia . android . app . administrator controls . administrator controls item view model . Administrator Controls General ViewModel Ċ import Ġorg . opp ia . android . app . administrator controls . administrator controls item view model . Administrator Controls Item ViewModel Ċ import Ġorg . opp ia . android . app . administrator controls . administrator controls item view model . Administrator Controls Profile ViewModel Ċ import Ġorg . opp ia . android . app . drawer . KEY _ NAV IG ATION _ PROFILE _ ID Ċ import Ġorg . opp ia . android . app . fragment . Fragment Scope Ċ import Ġorg . opp ia . android . app . model . Profile Id Ċ import Ġorg . opp ia . android . app . recyclerview . Bind able Adapter Ċ import Ġorg . opp ia . android . databinding . Administrator Controls Account Actions View Binding Ċ import Ġorg . opp ia . android . databinding . Administrator Controls App Information View Binding Ċ import Ġorg . opp ia . android . databinding . Administrator Controls Download Permissions View Binding Ċ import Ġorg . opp ia . android . databinding . Administrator Controls Fragment Binding Ċ import Ġorg . opp ia . android . databinding . Administrator Controls General View Binding Ċ import Ġorg . opp ia . android . databinding . Administrator Controls Profile View Binding Ċ import Ġjava . security . Invalid Parameter Exception Ċ import Ġjavax . inject . Inject Ċ Ċ /** ĠThe Ġpresenter Ġfor Ġ[ Administrator Controls Fragment ]. Ġ*/ Ċ @ Fragment Scope Ċ class ĠAdministrator Controls Fragment Presenter Ġ@ Inject Ġconstructor ( ĊĠ Ġprivate Ġval Ġactivity : ĠAppCompatActivity , ĊĠ Ġprivate Ġval Ġfragment : ĠFragment Ċ ) Ġ{ ĊĠ Ġprivate Ġlateinit Ġvar Ġbinding : ĠAdministrator Controls Fragment Binding ĊĠ Ġprivate Ġlateinit Ġvar Ġlinear LayoutManager : ĠLinearLayoutManager ĊĠ Ġprivate Ġvar Ġinternal Profile Id : ĠInt Ġ= Ġ- 1 ĊĠ Ġprivate Ġlateinit Ġvar Ġprofile Id : ĠProfile Id ĊĊĠ Ġ@ Inject ĊĠ Ġlateinit Ġvar Ġadministrator Controls ViewModel : ĠAdministrator Controls ViewModel ĊĊĠ Ġfun Ġhandle Create View ( ĊĠĠĠ Ġinflater : ĠLayoutInflater , ĊĠĠĠ Ġcontainer : ĠViewGroup ?, ĊĠĠĠ Ġis Multip ane : ĠBoolean ĊĠ Ġ): ĠView ? Ġ{ ĊĠĠĠ Ġbinding Ġ= ĊĠĠĠĠĠ ĠAdministrator Controls Fragment Binding ĊĠĠĠĠĠĠĠ Ġ. inflate ( ĊĠĠĠĠĠĠĠĠĠ Ġinflater , ĊĠĠĠĠĠĠĠĠĠ Ġcontainer , ĊĠĠĠĠĠĠĠĠĠ Ġ/* Ġattach To Root = Ġ*/ Ġfalse ĊĠĠĠĠĠĠĠ Ġ) ĊĊĠĠĠ Ġinternal Profile Id Ġ= Ġactivity . intent . getInt Extra ( KEY _ NAV IG ATION _ PROFILE _ ID , Ġ- 1 ) ĊĠĠĠ Ġprofile Id Ġ= ĠProfile Id . newBuilder (). set Internal Id ( internal Profile Id ). build () ĊĠĠĠ Ġadministrator Controls ViewModel . set Profile Id ( profile Id ) ĊĊĠĠĠ Ġlinear LayoutManager Ġ= ĠLinearLayoutManager ( activity . application Context ) ĊĊĠĠĠ Ġbinding . administrator Controls List . apply Ġ{ ĊĠĠĠĠĠ Ġlayout Manager Ġ= Ġlinear LayoutManager ĊĠĠĠĠĠ Ġadapter Ġ= Ġcreate RecyclerView Adapter ( is Multip ane ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġbinding . apply Ġ{ ĊĠĠĠĠĠ Ġthis . viewModel Ġ= Ġadministrator Controls ViewModel ĊĠĠĠĠĠ Ġthis . lifecycle Owner Ġ= Ġfragment ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġreturn Ġbinding . root ĊĠ Ġ} ĊĊĠ Ġprivate Ġfun Ġcreate RecyclerView Adapter ( is Multip ane : ĠBoolean ): ĊĠĠĠ ĠBind able Adapter < Administrator Controls Item ViewModel > Ġ{ ĊĠĠĠĠĠ Ġreturn ĠBind able Adapter . Multi Type Builder ĊĠĠĠĠĠĠĠ Ġ. newBuilder < Administrator Controls Item ViewModel , ĠView Type > Ġ{ ĠviewModel Ġ-> ĊĠĠĠĠĠĠĠĠĠ ĠviewModel . is Multip ane . set ( is Multip ane ) ĊĠĠĠĠĠĠĠĠĠ Ġwhen Ġ( viewModel ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġis ĠAdministrator Controls General ViewModel Ġ-> Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠviewModel . item Index . set ( 0 ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠView Type . VIEW _ TYPE _ GENERAL ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġis ĠAdministrator Controls Profile ViewModel Ġ-> Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠviewModel . item Index . set ( 1 ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠView Type . VIEW _ TYPE _ PROFILE ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġis ĠAdministrator Controls Download Permissions ViewModel Ġ-> Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠviewModel . item Index . set ( 2 ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠView Type . VIEW _ TYPE _ DOWNLOAD _ PERMISSION S ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġis ĠAdministrator Controls App Information ViewModel Ġ-> Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠviewModel . item Index . set ( 3 ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠView Type . VIEW _ TYPE _ APP _ INFORMATION ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġis ĠAdministrator Controls Account Actions ViewModel Ġ-> Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠviewModel . item Index . set ( 4 ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠ ĠView Type . VIEW _ TYPE _ ACCOUNT _ ACTION S ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġelse Ġ-> Ġthrow ĠIllegalArgumentException (" Encounter ed Ġunexpected Ġview Ġmodel : Ġ$ viewModel ") ĊĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġ. register ViewData Binder ( ĊĠĠĠĠĠĠĠĠĠ Ġview Type Ġ= ĠView Type . VIEW _ TYPE _ GENERAL , ĊĠĠĠĠĠĠĠĠĠ Ġinf late Data Binding Ġ= ĠAdministrator Controls General View Binding :: inflate , ĊĠĠĠĠĠĠĠĠĠ Ġset ViewModel Ġ= ĠAdministrator Controls General View Binding :: set ViewModel , ĊĠĠĠĠĠĠĠĠĠ Ġtransform ViewModel Ġ= Ġ{ Ġit Ġas ĠAdministrator Controls General ViewModel Ġ} ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġ. register ViewData Binder ( ĊĠĠĠĠĠĠĠĠĠ Ġview Type Ġ= ĠView Type . VIEW _ TYPE _ PROFILE , ĊĠĠĠĠĠĠĠĠĠ Ġinf late Data Binding Ġ= ĠAdministrator Controls Profile View Binding :: inflate , ĊĠĠĠĠĠĠĠĠĠ Ġset ViewModel Ġ= Ġthis :: bind Profile List , ĊĠĠĠĠĠĠĠĠĠ Ġtransform ViewModel Ġ= Ġ{ Ġit Ġas ĠAdministrator Controls Profile ViewModel Ġ} ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġ. register ViewData Binder ( ĊĠĠĠĠĠĠĠĠĠ Ġview Type Ġ= ĠView Type . VIEW _ TYPE _ DOWNLOAD _ PERMISSION S , ĊĠĠĠĠĠĠĠĠĠ Ġinf late Data Binding Ġ= ĠAdministrator Controls Download Permissions View Binding :: inflate , ĊĠĠĠĠĠĠĠĠĠ Ġset ViewModel Ġ= ĠAdministrator Controls Download Permissions View Binding :: set ViewModel , ĊĠĠĠĠĠĠĠĠĠ Ġtransform ViewModel Ġ= Ġ{ Ġit Ġas ĠAdministrator Controls Download Permissions ViewModel Ġ} ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġ. register ViewData Binder ( ĊĠĠĠĠĠĠĠĠĠ Ġview Type Ġ= ĠView Type . VIEW _ TYPE _ APP _ INFORMATION , ĊĠĠĠĠĠĠĠĠĠ Ġinf late Data Binding Ġ= ĠAdministrator Controls App Information View Binding :: inflate , ĊĠĠĠĠĠĠĠĠĠ Ġset ViewModel Ġ= Ġthis :: bind App Version , ĊĠĠĠĠĠĠĠĠĠ Ġtransform ViewModel Ġ= Ġ{ Ġit Ġas ĠAdministrator Controls App Information ViewModel Ġ} ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġ. register ViewData Binder ( ĊĠĠĠĠĠĠĠĠĠ Ġview Type Ġ= ĠView Type . VIEW _ TYPE _ ACCOUNT _ ACTION S , ĊĠĠĠĠĠĠĠĠĠ Ġinf late Data Binding Ġ= ĠAdministrator Controls Account Actions View Binding :: inflate , ĊĠĠĠĠĠĠĠĠĠ Ġset ViewModel Ġ= ĠAdministrator Controls Account Actions View Binding :: set ViewModel , ĊĠĠĠĠĠĠĠĠĠ Ġtransform ViewModel Ġ= Ġ{ Ġit Ġas ĠAdministrator Controls Account Actions ViewModel Ġ} ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġ. build () ĊĠĠĠ Ġ} ĊĊĠ Ġprivate Ġfun Ġbind Profile List ( ĊĠĠĠ Ġbinding : ĠAdministrator Controls Profile View Binding , ĊĠĠĠ Ġmodel : ĠAdministrator Controls Profile ViewModel ĊĠ Ġ) Ġ{ ĊĠĠĠ Ġbinding . common ViewModel Ġ= Ġadministrator Controls ViewModel ĊĠĠĠ Ġbinding . viewModel Ġ= Ġmodel ĊĠ Ġ} ĊĊĠ Ġprivate Ġfun Ġbind App Version ( ĊĠĠĠ Ġbinding : ĠAdministrator Controls App Information View Binding , ĊĠĠĠ Ġmodel : ĠAdministrator Controls App Information ViewModel ĊĠ Ġ) Ġ{ ĊĠĠĠ Ġbinding . common ViewModel Ġ= Ġadministrator Controls ViewModel ĊĠĠĠ Ġbinding . viewModel Ġ= Ġmodel ĊĠ Ġ} ĊĊĠ Ġfun ĠsetSelected Fragment ( selected Fragment : ĠString ) Ġ{ ĊĠĠĠ Ġadministrator Controls ViewModel . selected Fragment Index . set ( ĊĠĠĠĠĠ Ġget Selected Fragment Index ( ĊĠĠĠĠĠĠĠ Ġselected Fragment ĊĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġprivate Ġfun Ġget Selected Fragment Index ( selected Fragment : ĠString ): ĠInt Ġ{ ĊĠĠĠ Ġreturn Ġwhen Ġ( selected Fragment ) Ġ{ ĊĠĠĠĠĠ ĠPRO FILE _ LIST _ FRAGMENT Ġ-> Ġ 1 ĊĠĠĠĠĠ ĠAPP _ VERSION _ FRAGMENT Ġ-> Ġ 3 ĊĠĠĠĠĠ Ġelse Ġ-> Ġthrow ĠInvalid Parameter Exception (" Not Ġa Ġvalid Ġfragment Ġin Ġget Selected Fragment Index .") ĊĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġprivate Ġenum Ġclass ĠView Type Ġ{ ĊĠĠĠ ĠVIEW _ TYPE _ GENERAL , ĊĠĠĠ ĠVIEW _ TYPE _ PROFILE , ĊĠĠĠ ĠVIEW _ TYPE _ DOWNLOAD _ PERMISSION S , ĊĠĠĠ ĠVIEW _ TYPE _ APP _ INFORMATION , ĊĠĠĠ ĠVIEW _ TYPE _ ACCOUNT _ ACTION S ĊĠ Ġ} Ċ } Ċ