package Ġan lib an . sky word . presenter . view Ċ Ċ import Ġandroid . content . Intent Ċ import Ġandroid . os . Bundle Ċ import Ġandroidx . appcompat . app . AppCompatActivity Ċ import Ġandroidx . lifecycle . Observer Ċ import Ġandroidx . lifecycle . ViewModel Providers Ċ import Ġan lib an . sky word . R Ċ import Ġan lib an . sky word . data . source . local . Local DataSource Ċ import Ġan lib an . sky word . data . source . local . Pref Model Ċ import Ġan lib an . sky word . data . source . remote . Firebase Auth DataSource Ċ import Ġan lib an . sky word . databinding . Activity Splash Binding Ċ import Ġan lib an . sky word . presenter . view model . Splash ViewModel Ċ import Ġan lib an . sky word . presenter . view model . Splash ViewModel Factory Ċ import Ġan lib an . sky word . repository . Splash Repository Ċ Ċ class ĠSpl ash Activity Ġ: ĠAppCompatActivity (), ĠI Data Binding Ġ{ ĊĊĠĠĠ Ġoverride Ġval Ġresource Id Ġ= ĠR . layout . activity _ splash ĊĠĠĠ Ġprivate Ġval Ġbinding Ġby Ġlazy Ġ{ Ġbind < Activity Splash Binding >( this ) Ġ} ĊĠĠĠ Ġprivate Ġval Ġpref Model Ġby Ġlazy Ġ{ ĠPref Model ( this ) Ġ} ĊĠĠĠ Ġprivate Ġval Ġauth DataSource Ġ= ĠFirebase Auth DataSource () ĊĠĠĠ Ġprivate Ġval Ġlocal DataSource Ġby Ġlazy Ġ{ ĠLocal DataSource ( pref Model ) Ġ} ĊĠĠĠ Ġprivate Ġval Ġrepository Ġby Ġlazy Ġ{ ĠSpl ash Repository ( auth DataSource , Ġlocal DataSource ) Ġ} ĊĠĠĠ Ġprivate Ġval ĠviewModel Ġby Ġlazy Ġ{ ĊĠĠĠĠĠĠĠ ĠViewModel Providers . of ( this , ĠSpl ash ViewModel Factory ( repository ))[ Splash ViewModel :: class . java ] ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate ( savedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . onCreate ( savedInstanceState ) ĊĠĠĠĠĠĠĠ Ġbinding ĊĠĠĠĠĠĠĠ ĠviewModel . login () ĊĠĠĠĠĠĠĠ ĠviewModel . login . observe ( this , ĠObserver Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠstartActivity ( Intent ( this , ĠSend Message Activity :: class . java )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġfinish () ĊĠĠĠĠĠĠĠ Ġ}) ĊĠĠĠĠĠĠĠ ĠviewModel . login Failure . observe ( this , ĠObserver Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠstartActivity ( Intent ( this , ĠLogin Activity :: class . java )) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġfinish () ĊĠĠĠĠĠĠĠ Ġ}) ĊĠĠĠ Ġ} Ċ }