package Ġcom . aus ich enko . test . per ception . view . intro Ċ Ċ import Ġandroid . arch . lifecycle . ViewModel Providers Ċ import Ġandroid . os . Bundle Ċ import Ġandroid . support . v 4 . app . Fragment Ċ import Ġandroid . support . v 4 . content . Context Compat Ċ import Ġcom . aus ich enko . test . per ception . Per ception Application Ċ import Ġcom . aus ich enko . test . per ception . R Ċ import Ġcom . github . pa ol or oto lo . app intro . App Intro Ċ import Ġcom . github . pa ol or oto lo . app intro . App Intro Fragment Ċ import Ġcom . github . pa ol or oto lo . app intro . model . Slider Page Ċ import Ġcom . google . firebase . analytics . Firebase Analytics Ċ import Ġjavax . inject . Inject Ċ Ċ class ĠIntro Activity Ġ: ĠApp Intro () Ġ{ ĊĊĠĠĠ Ġ@ Inject ĊĠĠĠ Ġlateinit Ġvar Ġfirebase Analytics : ĠFirebase Analytics ĊĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġintro ViewModel : ĠIntro ViewModel ĊĊĠĠĠ Ġinit Ġ{ ĊĠĠĠĠĠĠĠ ĠPer ception Application . app Component . inject ( this ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate ( savedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . onCreate ( savedInstanceState ) ĊĊĠĠĠĠĠĠĠ Ġinit ViewModel () ĊĠĠĠĠĠĠĠ Ġinit Pages () ĊĠĠĠĠĠĠĠ Ġfirebase Analytics . setCurrent Screen ( this , Ġ" intro ", Ġnull ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġinit ViewModel () Ġ{ ĊĠĠĠĠĠĠĠ Ġintro ViewModel Ġ= ĠViewModel Providers . of ( this ). get ( Intro ViewModel :: class . java ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġinit Pages () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġstart Page Ġ= ĠSlider Page () ĊĠĠĠĠĠĠĠ Ġstart Page . title Ġ= ĠgetString ( R . string . tutorial _ start _ title ) ĊĠĠĠĠĠĠĠ Ġstart Page . description Ġ= ĠgetString ( R . string . tutorial _ start _ description ) ĊĠĠĠĠĠĠĠ Ġstart Page . image Drawable Ġ= ĠR . drawable . start ĊĠĠĠĠĠĠĠ Ġstart Page . bgColor Ġ= ĠContext Compat . getColor ( application Context , ĠR . color . primary ) ĊĠĠĠĠĠĠĠ Ġadd Slide ( App Intro Fragment . newInstance ( start Page )) ĊĠĠĠĠĠĠĠ Ġval Ġshow Page Ġ= ĠSlider Page () ĊĠĠĠĠĠĠĠ Ġshow Page . title Ġ= ĠgetString ( R . string . tutorial _ show _ title ) ĊĠĠĠĠĠĠĠ Ġshow Page . description Ġ= ĠgetString ( R . string . tutorial _ show _ description ) ĊĠĠĠĠĠĠĠ Ġshow Page . image Drawable Ġ= ĠR . drawable . show ĊĠĠĠĠĠĠĠ Ġshow Page . bgColor Ġ= ĠContext Compat . getColor ( application Context , ĠR . color . primary ) ĊĠĠĠĠĠĠĠ Ġadd Slide ( App Intro Fragment . newInstance ( show Page )) ĊĠĠĠĠĠĠĠ Ġval Ġwrite Page Ġ= ĠSlider Page () ĊĠĠĠĠĠĠĠ Ġwrite Page . title Ġ= ĠgetString ( R . string . tutorial _ write _ title ) ĊĠĠĠĠĠĠĠ Ġwrite Page . description Ġ= ĠgetString ( R . string . tutorial _ write _ description ) ĊĠĠĠĠĠĠĠ Ġwrite Page . image Drawable Ġ= ĠR . drawable . write ĊĠĠĠĠĠĠĠ Ġwrite Page . bgColor Ġ= ĠContext Compat . getColor ( application Context , ĠR . color . primary ) ĊĠĠĠĠĠĠĠ Ġadd Slide ( App Intro Fragment . newInstance ( write Page )) ĊĠĠĠĠĠĠĠ Ġval Ġresult Page Ġ= ĠSlider Page () ĊĠĠĠĠĠĠĠ Ġresult Page . title Ġ= ĠgetString ( R . string . tutorial _ result _ title ) ĊĠĠĠĠĠĠĠ Ġresult Page . description Ġ= ĠgetString ( R . string . tutorial _ result _ description ) ĊĠĠĠĠĠĠĠ Ġresult Page . image Drawable Ġ= ĠR . drawable . result ĊĠĠĠĠĠĠĠ Ġresult Page . bgColor Ġ= ĠContext Compat . getColor ( application Context , ĠR . color . primary ) ĊĠĠĠĠĠĠĠ Ġadd Slide ( App Intro Fragment . newInstance ( result Page )) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Skip Pressed ( current Fragment : ĠFragment ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . on Skip Pressed ( current Fragment ) ĊĊĠĠĠĠĠĠĠ Ġintro ViewModel . set Non First Start () ĊĠĠĠĠĠĠĠ Ġfinish () ĊĠĠĠĠĠĠĠ Ġfirebase Analytics . log Event (" intro _ skipped ", Ġnull ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Done Pressed ( current Fragment : ĠFragment ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . on Done Pressed ( current Fragment ) ĊĊĠĠĠĠĠĠĠ Ġintro ViewModel . set Non First Start () ĊĠĠĠĠĠĠĠ Ġfinish () ĊĠĠĠĠĠĠĠ Ġfirebase Analytics . log Event (" intro _ done ", Ġnull ) ĊĠĠĠ Ġ} Ċ }