package Ġorg . opp ia . app . player . ex ploration Ċ Ċ import Ġandroid . content . Context Ċ import Ġandroid . content . Intent Ċ import Ġandroid . os . Bundle Ċ import Ġandroid . view . Menu Ċ import Ġorg . opp ia . app . R Ċ import Ġorg . opp ia . app . activity . Injectable AppCompatActivity Ċ import Ġorg . opp ia . app . player . audio . Audio Button Listener Ċ import Ġorg . opp ia . app . player . state . hint sand solution . Hints And Solution Fragment Ċ import Ġorg . opp ia . app . player . state . hint sand solution . Hints And Solution Listener Ċ import Ġorg . opp ia . app . player . state . hint sand solution . Re veal Hint Listener Ċ import Ġorg . opp ia . app . player . state . hint sand solution . Re veal Solution Interface Ċ import Ġorg . opp ia . app . player . state . listener . Route To Hints And Solution Listener Ċ import Ġorg . opp ia . app . player . state . listener . State Keyboard Button Listener Ċ import Ġorg . opp ia . app . player . stop ex ploration . Stop Ex ploration Dialog Fragment Ċ import Ġorg . opp ia . app . player . stop ex ploration . Stop Ex ploration Interface Ċ import Ġjavax . inject . Inject Ċ Ċ private Ġconst Ġval ĠTAG _ STOP _ EX PL OR ATION _ DIALOG Ġ= Ġ" STOP _ EX PL OR ATION _ DIALOG " Ċ const Ġval ĠTAG _ HINT S _ AND _ SOL UTION _ DIALOG Ġ= Ġ" HINT S _ AND _ SOL UTION _ DIALOG " Ċ Ċ /** ĠThe Ġstarting Ġpoint Ġfor Ġexploration . Ġ*/ Ċ class ĠEx ploration Activity Ġ: ĠInjectable AppCompatActivity (), ĠStop Ex ploration Interface , ĠState Keyboard Button Listener , ĊĠ ĠAudio Button Listener , ĠH ints And Solution Listener , ĠRoute To Hints And Solution Listener , ĠRe veal Hint Listener , ĊĠ ĠRe veal Solution Interface Ġ{ ĊĊĠ Ġ@ Inject Ġlateinit Ġvar Ġexploration Activity Presenter : ĠEx ploration 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 ĊĊĠ Ġoverride Ġfun ĠonCreate ( savedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠ Ġsuper . onCreate ( savedInstanceState ) ĊĠĠĠ Ġactivity Component . inject ( this ) ĊĠĠĠ Ġinternal Profile Id Ġ= Ġintent . getInt Extra ( EX PL OR ATION _ ACTIVITY _ PROFILE _ ID _ ARGUMENT _ KEY , Ġ- 1 ) ĊĠĠĠ Ġtopic Id Ġ= Ġintent . getString Extra ( EX PL OR ATION _ ACTIVITY _ TOPIC _ ID _ ARGUMENT _ KEY ) ĊĠĠĠ Ġstory Id Ġ= Ġintent . getString Extra ( EX PL OR ATION _ ACTIVITY _ ST ORY _ ID _ ARGUMENT _ KEY ) ĊĠĠĠ Ġexploration Id Ġ= Ġintent . getString Extra ( EX PL OR ATION _ ACTIVITY _ EX PL OR ATION _ ID _ ARGUMENT _ KEY ) ĊĠĠĠ Ġexploration Activity Presenter . handle On Create ( internal Profile Id , Ġtopic Id , Ġstory Id , Ġexploration Id ) ĊĠ Ġ} ĊĊĠ Ġcompanion Ġobject Ġ{ ĊĠĠĠ Ġ/** ĠReturns Ġa Ġnew Ġ[ Intent ] Ġto Ġroute Ġto Ġ[ Ex ploration Activity ] Ġfor Ġa Ġspecified Ġexploration . Ġ*/ ĊĊĠĠĠ Ġinternal Ġconst Ġval ĠEX PL OR ATION _ ACTIVITY _ PROFILE _ ID _ ARGUMENT _ KEY Ġ= Ġ" Ex ploration Activity . profile _ id " ĊĠĠĠ Ġinternal Ġconst Ġval ĠEX PL OR ATION _ ACTIVITY _ TOPIC _ ID _ ARGUMENT _ KEY Ġ= Ġ" Ex ploration Activity . topic _ id " ĊĠĠĠ Ġinternal Ġconst Ġval ĠEX PL OR ATION _ ACTIVITY _ ST ORY _ ID _ ARGUMENT _ KEY Ġ= Ġ" Ex ploration Activity . story _ id " ĊĠĠĠ Ġinternal Ġconst Ġval ĠEX PL OR ATION _ ACTIVITY _ EX PL OR ATION _ ID _ ARGUMENT _ KEY Ġ= Ġ" Ex ploration Activity . ex ploration _ id " ĊĠĠĠ Ġfun Ġcreate Ex ploration Activity Intent ( ĊĠĠĠĠĠ Ġcontext : ĠContext , ĊĠĠĠĠĠ Ġprofile Id : ĠInt , ĊĠĠĠĠĠ Ġtopic Id : ĠString , ĊĠĠĠĠĠ Ġstory Id : ĠString , ĊĠĠĠĠĠ Ġexploration Id : ĠString ĊĠĠĠ Ġ): ĠIntent Ġ{ ĊĠĠĠĠĠ Ġval Ġintent Ġ= ĠIntent ( context , ĠEx ploration Activity :: class . java ) ĊĠĠĠĠĠ Ġintent . putExtra ( EX PL OR ATION _ ACTIVITY _ PROFILE _ ID _ ARGUMENT _ KEY , Ġprofile Id ) ĊĠĠĠĠĠ Ġintent . putExtra ( EX PL OR ATION _ ACTIVITY _ TOPIC _ ID _ ARGUMENT _ KEY , Ġtopic Id ) ĊĠĠĠĠĠ Ġintent . putExtra ( EX PL OR ATION _ ACTIVITY _ ST ORY _ ID _ ARGUMENT _ KEY , Ġstory Id ) ĊĠĠĠĠĠ Ġintent . putExtra ( EX PL OR ATION _ ACTIVITY _ EX PL OR ATION _ ID _ ARGUMENT _ KEY , Ġexploration Id ) ĊĠĠĠĠĠ Ġreturn Ġintent ĊĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun Ġon Back Pressed () Ġ{ ĊĠĠĠ Ġshow Stop Ex ploration Dialog Fragment () ĊĠ Ġ} ĊĊĠ Ġprivate Ġfun Ġshow Stop Ex ploration Dialog Fragment () Ġ{ ĊĠĠĠ Ġval Ġprevious Fragment Ġ= Ġsupport FragmentManager . find Fragment By Tag ( TAG _ STOP _ EX PL OR ATION _ DIALOG ) ĊĠĠĠ Ġif Ġ( previous Fragment Ġ!= Ġnull ) Ġ{ ĊĠĠĠĠĠ Ġsupport FragmentManager . beginTransaction (). remove ( previous Fragment ). commit Now () ĊĠĠĠ Ġ} ĊĠĠĠ Ġval Ġdialog Fragment Ġ= ĠStop Ex ploration Dialog Fragment . newInstance () ĊĠĠĠ Ġdialog Fragment . show Now ( support FragmentManager , ĠTAG _ STOP _ EX PL OR ATION _ DIALOG ) ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun Ġstop Ex ploration () Ġ{ ĊĠĠĠ Ġexploration Activity Presenter . stop Ex ploration () ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun ĠonCreate Options Menu ( menu : ĠMenu ?): ĠBoolean Ġ{ ĊĠĠĠ Ġmenu Inflater . inflate ( R . menu . menu _ ex ploration _ activity , Ġmenu ) ĊĠĠĠ Ġreturn Ġsuper . onCreate Options Menu ( menu ) ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun Ġshow Audio Button () Ġ= Ġexploration Activity Presenter . show Audio Button () ĊĊĠ Ġoverride Ġfun Ġhide Audio Button () Ġ= Ġexploration Activity Presenter . hide Audio Button () ĊĊĠ Ġoverride Ġfun Ġshow Audio Streaming On () Ġ= Ġexploration Activity Presenter . show Audio Streaming On () ĊĊĠ Ġoverride Ġfun Ġshow Audio Streaming Off () Ġ= Ġexploration Activity Presenter . show Audio Streaming Off () ĊĊĠ Ġoverride Ġfun Ġset Audio Bar Visibility ( isVisible : ĠBoolean ) Ġ{ ĊĠĠĠ Ġexploration Activity Presenter . set Audio Bar Visibility ( isVisible ) ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun Ġscroll To Top () Ġ{ ĊĠĠĠ Ġexploration Activity Presenter . scrollTo Top () ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun Ġon Editor Action ( action Code : ĠInt ) Ġ{ ĊĠĠĠ Ġexploration Activity Presenter . on Keyboard Action ( action Code ) ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun Ġreveal Hint ( save User Choice : ĠBoolean , Ġhint Index : ĠInt ) Ġ{ ĊĠĠĠ Ġexploration Activity Presenter . reveal Hint ( save User Choice , Ġhint Index ) ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun Ġreveal Solution ( save User Choice : ĠBoolean ) Ġ{ ĊĠĠĠ Ġexploration Activity Presenter . reveal Solution ( save User Choice ) ĊĠ Ġ} ĊĊĠ Ġprivate Ġfun Ġget Hints And Solution (): ĠH ints And Solution Fragment ? Ġ{ ĊĠĠĠ Ġreturn Ġsupport FragmentManager . find Fragment By Tag ( TAG _ HINT S _ AND _ SOL UTION _ DIALOG ) Ġas ĠH ints And Solution Fragment ? ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun Ġroute To Hints And Solution ( ĊĠĠĠ Ġexploration Id : ĠString , ĊĠĠĠ Ġnew Available Hint Index : ĠInt , ĊĠĠĠ Ġall Hints Ex hausted : ĠBoolean ĊĠ Ġ) Ġ{ ĊĠĠĠ Ġif Ġ( get Hints And Solution () Ġ== Ġnull ) Ġ{ ĊĠĠĠĠĠ Ġval Ġhints And Solution Fragment Ġ= ĠH ints And Solution Fragment . newInstance ( ex ploration Id , Ġnew Available Hint Index , Ġall Hints Ex hausted ) ĊĠĠĠĠĠ Ġhints And Solution Fragment . show Now ( support FragmentManager , ĠTAG _ HINT S _ AND _ SOL UTION _ DIALOG ) ĊĠĠĠ Ġ} ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun Ġdismiss () Ġ{ ĊĠĠĠ Ġget Hints And Solution ()?. dismiss () ĊĠ Ġ} Ċ } Ċ