package Ġorg . opp ia . android . app . dev options . mark topics completed Ċ Ċ import Ġandroid . content . Context Ċ import Ġandroid . os . Bundle Ċ import Ġandroid . view . LayoutInflater Ċ import Ġandroid . view . View Ċ import Ġandroid . view . ViewGroup Ċ import Ġorg . opp ia . android . app . fragment . Injectable Fragment Ċ import Ġjavax . inject . Inject Ċ Ċ /** ĠFragment Ġto Ġdisplay Ġall Ġtopics Ġand Ġprovide Ġfunctionality Ġto Ġmark Ġthem Ġcompleted . Ġ*/ Ċ class ĠMark Topics Completed Fragment Ġ: ĠInjectable Fragment () Ġ{ ĊĠ Ġ@ Inject ĊĠ Ġlateinit Ġvar Ġmark Topics Completed Fragment Presenter : ĠMark Topics Completed Fragment Presenter ĊĊĠ Ġcompanion Ġobject Ġ{ ĊĠĠĠ Ġinternal Ġconst Ġval ĠMARK _ TOP ICS _ COMPLETED _ FRAGMENT _ PROFILE _ ID _ KEY Ġ= ĊĠĠĠĠĠ Ġ" Mark Topics Completed Fragment . internal _ profile _ id " ĊĊĠĠĠ Ġprivate Ġconst Ġval ĠTOP IC _ ID _ LIST _ ARGUMENT _ KEY Ġ= Ġ" Mark Topics Completed Fragment . topic _ id _ list " ĊĊĠĠĠ Ġ/** ĠReturns Ġa Ġnew Ġ[ Mark Topics Completed Fragment ]. Ġ*/ ĊĠĠĠ Ġfun Ġnew Instance ( internal Profile Id : ĠInt ): ĠMark Topics Completed Fragment Ġ{ ĊĠĠĠĠĠ Ġval Ġmark Topics Completed Fragment Ġ= ĠMark Topics Completed Fragment () ĊĠĠĠĠĠ Ġval Ġargs Ġ= ĠBundle () ĊĠĠĠĠĠ Ġargs . put Int ( MARK _ TOP ICS _ COMPLETED _ FRAGMENT _ PROFILE _ ID _ KEY , Ġinternal Profile Id ) ĊĠĠĠĠĠ Ġmark Topics Completed Fragment . arguments Ġ= Ġargs ĊĠĠĠĠĠ Ġreturn Ġmark Topics Completed Fragment ĊĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun Ġon Attach ( context : ĠContext ) Ġ{ ĊĠĠĠ Ġsuper . on Attach ( context ) ĊĠĠĠ Ġfragment Component . inject ( this ) ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun ĠonCreate View ( ĊĠĠĠ Ġinflater : ĠLayoutInflater , ĊĠĠĠ Ġcontainer : ĠViewGroup ?, ĊĠĠĠ ĠsavedInstanceState : ĠBundle ? ĊĠ Ġ): ĠView ? Ġ{ ĊĠĠĠ Ġval Ġargs Ġ= ĊĠĠĠĠĠ ĠcheckNotNull ( arguments ) Ġ{ Ġ" Expected Ġarguments Ġto Ġbe Ġpassed Ġto ĠMark Topics Completed Fragment " Ġ} ĊĠĠĠ Ġval Ġinternal Profile Id Ġ= Ġargs ĊĠĠĠĠĠ Ġ. getInt ( MARK _ TOP ICS _ COMPLETED _ FRAGMENT _ PROFILE _ ID _ KEY , Ġ- 1 ) ĊĠĠĠ Ġvar Ġselected Topic IdList Ġ= ĠArrayList < String >() ĊĠĠĠ Ġif Ġ( savedInstanceState Ġ!= Ġnull ) Ġ{ ĊĠĠĠĠĠ Ġselected Topic IdList Ġ= ĠsavedInstanceState . getString ArrayList ( TOPIC _ ID _ LIST _ ARGUMENT _ KEY ) !! ĊĠĠĠ Ġ} ĊĠĠĠ Ġreturn Ġmark Topics Completed Fragment Presenter . handle Create View ( ĊĠĠĠĠĠ Ġinflater , ĊĠĠĠĠĠ Ġcontainer , ĊĠĠĠĠĠ Ġinternal Profile Id , ĊĠĠĠĠĠ Ġselected Topic IdList ĊĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun Ġon Save InstanceState ( out State : ĠBundle ) Ġ{ ĊĠĠĠ Ġsuper . on Save InstanceState ( out State ) ĊĠĠĠ Ġout State . putString ArrayList ( ĊĠĠĠĠĠ ĠTOP IC _ ID _ LIST _ ARGUMENT _ KEY , ĊĠĠĠĠĠ Ġmark Topics Completed Fragment Presenter . selected Topic IdList ĊĠĠĠ Ġ) ĊĠ Ġ} Ċ } Ċ