package Ġorg . opp ia . android . app . resume lesson Ċ Ċ import Ġandroid . content . Context Ċ import Ġandroid . content . Intent Ċ import Ġandroid . os . Bundle Ċ import Ġorg . opp ia . android . app . activity . Activity Component Impl Ċ import Ġorg . opp ia . android . app . activity . Injectable AppCompatActivity Ċ import Ġorg . opp ia . android . app . home . Route To Ex ploration Listener Ċ import Ġorg . opp ia . android . app . model . Ex ploration Checkpoint Ċ import Ġorg . opp ia . android . app . player . ex ploration . Ex ploration Activity Ċ import Ġjavax . inject . Inject Ċ Ċ /** ĠActivity Ġthat Ġallows Ġthe Ġuser Ġto Ġresume Ġa Ġsaved Ġexploration . Ġ*/ Ċ class ĠResume Lesson Activity Ġ: ĠInjectable AppCompatActivity (), ĠRoute To Ex ploration Listener Ġ{ ĊĊĠ Ġ@ Inject ĊĠ Ġlateinit Ġvar Ġresume Lesson Activity Presenter : ĠResume Lesson Activity Presenter ĊĠ Ġprivate Ġvar Ġinternal Profile Id : ĠInt Ġ= Ġ- 1 ĊĠ Ġprivate Ġlateinit Ġvar Ġtopic Id : ĠString ĊĠ Ġprivate Ġlateinit Ġvar Ġstory Id : ĠString ĊĠ Ġprivate Ġlateinit Ġvar Ġexploration Id : ĠString ĊĠ Ġprivate Ġlateinit Ġvar Ġexploration Checkpoint : ĠEx ploration Checkpoint ĊĠ Ġprivate Ġvar Ġback flow Screen : ĠInt Ġ= Ġ- 1 ĊĊĠ Ġoverride Ġfun ĠonCreate ( savedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠ Ġsuper . onCreate ( savedInstanceState ) ĊĠĠĠ Ġ( activity Component Ġas ĠActivity Component Impl ). inject ( this ) ĊĠĠĠ Ġinternal Profile Id Ġ= ĊĠĠĠĠĠ Ġintent . getInt Extra ( RE SU ME _ LESS ON _ ACTIVITY _ INTERNAL _ PROFILE _ ID _ ARGUMENT _ KEY , Ġ- 1 ) ĊĠĠĠ Ġtopic Id Ġ= ĊĠĠĠĠĠ ĠcheckNotNull ( intent . getString Extra ( RE SU ME _ LESS ON _ ACTIVITY _ TOPIC _ ID _ ARGUMENT _ KEY )) Ġ{ ĊĠĠĠĠĠĠĠ Ġ" Expected Ġtopic ĠID Ġto Ġbe Ġincluded Ġin Ġintent Ġfor ĠResume Lesson Activity ." ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġstory Id Ġ= ĊĠĠĠĠĠ ĠcheckNotNull ( intent . getString Extra ( RE SU ME _ LESS ON _ ACTIVITY _ ST ORY _ ID _ ARGUMENT _ KEY )) Ġ{ ĊĠĠĠĠĠĠĠ Ġ" Expected Ġstory ĠID Ġto Ġbe Ġincluded Ġin Ġintent Ġfor ĠResume Lesson Activity ." ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġexploration Id Ġ= ĊĠĠĠĠĠ ĠcheckNotNull ( intent . getString Extra ( RE SU ME _ LESS ON _ ACTIVITY _ EX PL OR ATION _ ID _ ARGUMENT _ KEY )) Ġ{ ĊĠĠĠĠĠĠĠ Ġ" Expected Ġexploration ĠID Ġto Ġbe Ġincluded Ġin Ġintent Ġfor ĠResume Lesson Activity ." ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġback flow Screen Ġ= Ġintent . getInt Extra ( RE SU ME _ LESS ON _ ACTIVITY _ BACK FLOW _ SCREEN _ KEY , Ġ- 1 ) ĊĠĠĠ Ġexploration Checkpoint Ġ= ĠEx ploration Checkpoint . parseFrom ( ĊĠĠĠĠĠ Ġintent . get ByteArray Extra ( RE SU ME _ LESS ON _ ACTIVITY _ EX PL OR ATION _ CHECK POINT _ ARGUMENT _ KEY ) ĊĠĠĠ Ġ) ĊĠĠĠ Ġresume Lesson Activity Presenter . handle On Create ( ĊĠĠĠĠĠ Ġinternal Profile Id , ĊĠĠĠĠĠ Ġtopic Id , ĊĠĠĠĠĠ Ġstory Id , ĊĠĠĠĠĠ Ġexploration Id , ĊĠĠĠĠĠ Ġback flow Screen , ĊĠĠĠĠĠ Ġexploration Checkpoint ĊĠĠĠ Ġ) ĊĠ Ġ} ĊĊĠ Ġ// ĠTODO (# 1 6 5 5 ): ĠRe - restrict Ġaccess Ġto Ġfields Ġin Ġtests Ġpost - Gradle . ĊĠ Ġcompanion Ġobject Ġ{ ĊĠĠĠ Ġ/** ĠArgument Ġkey Ġfor Ġinternal Ġprofile ĠID Ġin Ġ[ Resume Lesson Activity ] Ġ*/ ĊĠĠĠ Ġconst Ġval ĠRES UME _ LESS ON _ ACTIVITY _ INTERNAL _ PROFILE _ ID _ ARGUMENT _ KEY Ġ= ĊĠĠĠĠĠ Ġ" Resume Lesson Activity . internal _ profile _ id " ĊĊĠĠĠ Ġ/** ĠArgument Ġkey Ġfor Ġtopic ĠID Ġin Ġ[ Resume Lesson Activity ] Ġ*/ ĊĠĠĠ Ġconst Ġval ĠRES UME _ LESS ON _ ACTIVITY _ TOPIC _ ID _ ARGUMENT _ KEY Ġ= ĊĠĠĠĠĠ Ġ" Resume Lesson Activity . topic _ id " ĊĊĠĠĠ Ġ/** ĠArgument Ġkey Ġfor Ġstory ĠID Ġin Ġ[ Resume Lesson Activity ] Ġ*/ ĊĠĠĠ Ġconst Ġval ĠRES UME _ LESS ON _ ACTIVITY _ ST ORY _ ID _ ARGUMENT _ KEY Ġ= ĊĠĠĠĠĠ Ġ" Resume Lesson Activity . story _ id " ĊĊĠĠĠ Ġ/** ĠArgument Ġkey Ġfor Ġexploration ĠID Ġin Ġ[ Resume Lesson Activity ] Ġ*/ ĊĠĠĠ Ġconst Ġval ĠRES UME _ LESS ON _ ACTIVITY _ EX PL OR ATION _ ID _ ARGUMENT _ KEY Ġ= ĊĠĠĠĠĠ Ġ" Resume Lesson Activity . ex ploration _ id " ĊĊĠĠĠ Ġ/** ĠArgument Ġkey Ġfor Ġback flow Ġscreen Ġin Ġ[ Resume Lesson Activity ] Ġ*/ ĊĠĠĠ Ġconst Ġval ĠRES UME _ LESS ON _ ACTIVITY _ BACK FLOW _ SCREEN _ KEY Ġ= ĊĠĠĠĠĠ Ġ" Resume Lesson Activity . back flow _ screen " ĊĊĠĠĠ Ġ/** ĠArgument Ġkey Ġfor Ġexploration Ġcheckpoint Ġin Ġ[ Resume Lesson Activity ] Ġ*/ ĊĠĠĠ Ġconst Ġval ĠRES UME _ LESS ON _ ACTIVITY _ EX PL OR ATION _ CHECK POINT _ ARGUMENT _ KEY Ġ= ĊĠĠĠĠĠ Ġ" Resume Lesson Activity . ex ploration _ checkpoint " ĊĊĠĠĠ Ġ/** ĊĠĠĠĠ Ġ* ĠReturns Ġa Ġnew Ġ[ Intent ] Ġto Ġroute Ġto Ġ[ Resume Lesson Activity ] Ġfor Ġa Ġspecified Ġexploration . ĊĠĠĠĠ Ġ*/ ĊĠĠĠ Ġfun Ġcreate Resume Lesson Activity Intent ( ĊĠĠĠĠĠ Ġcontext : ĠContext , ĊĠĠĠĠĠ Ġinternal Profile Id : ĠInt , ĊĠĠĠĠĠ Ġtopic Id : ĠString , ĊĠĠĠĠĠ Ġstory Id : ĠString , ĊĠĠĠĠĠ Ġexploration Id : ĠString , ĊĠĠĠĠĠ Ġback flow Screen : ĠInt ?, ĊĠĠĠĠĠ Ġexploration Checkpoint : ĠEx ploration Checkpoint ĊĠĠĠ Ġ): ĠIntent Ġ{ ĊĠĠĠĠĠ Ġval Ġintent Ġ= ĠIntent ( context , ĠResume Lesson Activity :: class . java ) ĊĠĠĠĠĠ Ġintent . putExtra ( RE SU ME _ LESS ON _ ACTIVITY _ INTERNAL _ PROFILE _ ID _ ARGUMENT _ KEY , Ġinternal Profile Id ) ĊĠĠĠĠĠ Ġintent . putExtra ( RE SU ME _ LESS ON _ ACTIVITY _ TOPIC _ ID _ ARGUMENT _ KEY , Ġtopic Id ) ĊĠĠĠĠĠ Ġintent . putExtra ( RE SU ME _ LESS ON _ ACTIVITY _ ST ORY _ ID _ ARGUMENT _ KEY , Ġstory Id ) ĊĠĠĠĠĠ Ġintent . putExtra ( RE SU ME _ LESS ON _ ACTIVITY _ EX PL OR ATION _ ID _ ARGUMENT _ KEY , Ġexploration Id ) ĊĠĠĠĠĠ Ġintent . putExtra ( RE SU ME _ LESS ON _ ACTIVITY _ BACK FLOW _ SCREEN _ KEY , Ġback flow Screen ) ĊĠĠĠĠĠ Ġintent . putExtra ( ĊĠĠĠĠĠĠĠ ĠRES UME _ LESS ON _ ACTIVITY _ EX PL OR ATION _ CHECK POINT _ ARGUMENT _ KEY , ĊĠĠĠĠĠĠĠ Ġexploration Checkpoint . toByteArray () ĊĠĠĠĠĠ Ġ) ĊĠĠĠĠĠ Ġreturn Ġintent ĊĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun Ġroute To Ex ploration ( ĊĠĠĠ Ġinternal Profile Id : ĠInt , ĊĠĠĠ Ġtopic Id : ĠString , ĊĠĠĠ Ġstory Id : ĠString , ĊĠĠĠ Ġexploration Id : ĠString , ĊĠĠĠ Ġback flow Screen : ĠInt ?, ĊĠĠĠ Ġis Checkpoint ing Enabled : ĠBoolean ĊĠ Ġ) Ġ{ ĊĠĠĠ ĠstartActivity ( ĊĠĠĠĠĠ ĠEx ploration Activity . create Ex ploration Activity Intent ( ĊĠĠĠĠĠĠĠ Ġthis , ĊĠĠĠĠĠĠĠ Ġinternal Profile Id , ĊĠĠĠĠĠĠĠ Ġtopic Id , ĊĠĠĠĠĠĠĠ Ġstory Id , ĊĠĠĠĠĠĠĠ Ġexploration Id , ĊĠĠĠĠĠĠĠ Ġback flow Screen , ĊĠĠĠĠĠĠĠ Ġis Checkpoint ing Enabled ĊĠĠĠĠĠ Ġ) ĊĠĠĠ Ġ) ĊĠĠĠ Ġfinish () ĊĠ Ġ} Ċ } Ċ