package Ġcom . l uk itor . my application C Ċ Ċ import Ġandroid . content . Intent Ċ import Ġandroid . graphics . Color Ċ import Ġandroid . os . Bundle Ċ import Ġandroidx . appcompat . app . AppCompatActivity Ċ import Ġandroidx . lifecycle . Observer Ċ import Ġandroidx . lifecycle . ViewModel Provider Ċ import Ġcom . l uk itor . my application C . data . room . database . User Database Ċ import Ġcom . l uk itor . my application C . data . room . entity . Users Ċ import Ġcom . l uk itor . my application C . databinding . Activity Get Started Home Binding Ċ import Ġcom . l uk itor . my application C . view model . User ViewModel Ċ import Ġcom . l uk itor . my application C . view model . ViewModel Factory Ċ import Ġcom . smart e ist . auto image slider . Indicator View . animation . type . Indicator Animation Type Ċ import Ġcom . smart e ist . auto image slider . Slider Animations Ċ import Ġcom . smart e ist . auto image slider . Slider View Ċ Ċ class ĠGet Started Home Activity Ġ: ĠAppCompatActivity () Ġ{ ĊĊĠĠĠ Ġlateinit Ġvar Ġslider View : ĠSlider View ĊĠĠĠ Ġlateinit Ġvar Ġadapter : ĠSlider Adapter ĊĠĠĠ Ġlateinit Ġvar Ġbinding : ĠActivity Get Started Home Binding ĊĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġuser Database : ĠUser Database ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate ( savedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . onCreate ( savedInstanceState ) ĊĠĠĠĠĠĠĠ Ġbinding Ġ= ĠActivity Get Started Home Binding . inflate ( layout Inflater ) ĊĠĠĠĠĠĠĠ ĠsetContentView ( binding . root ) ĊĊĠĠĠĠĠĠĠ Ġsupport ActionBar !!. hide () ĊĠĠĠĠĠĠĠ Ġval Ġmain ViewModel Ġ= Ġobtain ViewModel ( this @ Get Started Home Activity ) ĊĠĠĠĠĠĠĠ Ġmain ViewModel . getUser (). observe ( this , Ġusers Observer ) ĊĊĊĠĠĠĠĠĠĠ Ġslider View Ġ= Ġbinding . image Slider ĊĠĠĠĠĠĠĠ Ġadapter = Slider Adapter ( this ) ĊĠĠĠĠĠĠĠ Ġslider View . set Slider Adapter ( adapter ) ĊĊĠĠĠĠĠĠĠ Ġslider View . set Indicator Animation ( Indicator Animation Type . W ORM ) Ġ// set Ġindicator Ġanimation Ġby Ġusing ĠSlider Layout . Indicator Animations . Ġ: W ORM Ġor ĠTH IN _ W ORM Ġor ĠCOLOR Ġor ĠDROP Ġor ĠF ILL Ġor ĠNONE Ġor ĠSC ALE Ġor ĠSC ALE _ DOWN Ġor ĠSL IDE Ġand ĠSW AP !! ĊĊĠĠĠĠĠĠĠ Ġslider View . set Slider Transform Animation ( Slider Animations . SIMPLE TRANS FORMATION ) ĊĠĠĠĠĠĠĠ Ġslider View . auto Cycle Direction Ġ= ĠSlider View . AUTO _ CYCLE _ DIRECTION _ BACK _ AND _ FOR TH ĊĠĠĠĠĠĠĠ Ġslider View . indicator Selected Color Ġ= ĠColor . WHITE ĊĠĠĠĠĠĠĠ Ġslider View . indicator Un selected Color Ġ= ĠColor . GRAY ĊĠĠĠĠĠĠĠ Ġslider View . scroll TimeIn Sec Ġ= Ġ 3 ĊĠĠĠĠĠĠĠ Ġslider View . is Auto Cycle Ġ= Ġtrue ĊĠĠĠĠĠĠĠ Ġslider View . start Auto Cycle () ĊĠĠĠĠĠĠĠ Ġadd New Item () Ċ Ċ // ĠĠĠĠĠĠĠ Ġbinding . btn Get Started . setOnClickListener { Ċ // ĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġintent t = ĠIntent ( this , Activity Form Input :: class . java ) Ċ // ĠĠĠĠĠĠĠĠĠĠĠ ĠstartActivity ( intent t ) Ċ // ĠĠĠĠĠĠĠĠĠĠĠ Ġfinish () Ċ // ĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġadd New Item () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġslider Item Ġ= ĠSlider Item () ĊĠĠĠĠĠĠĠ Ġslider Item . description Ġ= Ġ" Sel amat ĠDat ang Ġdi ĠHealth ĠIns pector \ nB erg ab un gl ah ĠB ers ama ĠK ami " ĊĠĠĠĠĠĠĠ Ġslider Item . image = ĠR . drawable . gambar 1 m _ 1 0 8 0 x 1 9 2 0 ĊĠĠĠĠĠĠĠ Ġadapter . addItem ( slider Item ) ĊĠĠĠĠĠĠĠ Ġval Ġslider Item 2 Ġ= ĠSlider Item () ĊĠĠĠĠĠĠĠ Ġslider Item 2 . description Ġ= Ġ" K ami ĠH adir ĠUnt uk ĠMem b ant u ĠM eng ont rol ĠM akan an Ġ& ĠKe se h atan ĠAnd a " ĊĠĠĠĠĠĠĠ Ġslider Item 2 . image = ĠR . drawable . gambar 3 m _ 1 0 8 0 x 1 9 2 0 ĊĠĠĠĠĠĠĠ Ġadapter . addItem ( slider Item 2 ) ĊĠĠĠĠĠĠĠ Ġval Ġslider Item 3 Ġ= ĠSlider Item () ĊĠĠĠĠĠĠĠ Ġslider Item 3 . description Ġ= Ġ"" ĊĠĠĠĠĠĠĠ Ġslider Item 3 . image = ĠR . drawable . gambar 3 m _ 1 0 8 0 x 1 9 2 0 ĊĠĠĠĠĠĠĠ Ġadapter . addItem ( slider Item 3 ) ĊĠĠĠĠĠĠĠ Ġval Ġslider Item 4 Ġ= ĠSlider Item () ĊĠĠĠĠĠĠĠ Ġslider Item 4 . description Ġ= Ġ"" ĊĠĠĠĠĠĠĠ Ġslider Item 4 . image = ĠR . drawable . gambar 3 m _ 1 0 8 0 x 1 9 2 0 ĊĠĠĠĠĠĠĠ Ġadapter . addItem ( slider Item 4 ) ĊĠĠĠĠĠĠĠ Ġval Ġslider Item 5 Ġ= ĠSlider Item () ĊĠĠĠĠĠĠĠ Ġslider Item 5 . description Ġ= Ġ"" ĊĠĠĠĠĠĠĠ Ġslider Item 5 . image = ĠR . drawable . gambar 3 m _ 1 0 8 0 x 1 9 2 0 ĊĠĠĠĠĠĠĠ Ġadapter . addItem ( slider Item 5 ) ĊĠĠĠĠĠĠĠ Ġval Ġslider Item 6 Ġ= ĠSlider Item () ĊĠĠĠĠĠĠĠ Ġslider Item 6 . description Ġ= Ġ" Da ft ark an ĠDi ri mu ĠSe kar ang Ġ! " ĊĠĠĠĠĠĠĠ Ġslider Item 6 . image = ĠR . drawable . gambar 1 m _ 1 0 8 0 x 1 9 2 0 ĊĠĠĠĠĠĠĠ Ġadapter . addItem ( slider Item 6 ) ĊĠĠĠ Ġ} ĊĊĊĠĠĠ Ġprivate Ġfun Ġobtain ViewModel ( activity : ĠAppCompatActivity ): ĠUser ViewModel Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġfactory Ġ= ĠViewModel Factory . getInstance ( activity . application ) ĊĠĠĠĠĠĠĠ Ġreturn ĠViewModel Provider ( activity , Ġfactory ). get ( User ViewModel :: class . java ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġval Ġusers Observer Ġ= ĠObserver < Users > Ġ{ Ġusers Ġ-> ĊĠĠĠĠĠĠĠ Ġif Ġ( users Ġ!= Ġnull ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġvar Ġintent t = ĠIntent ( this , User Activity :: class . java ) ĊĠĠĠĠĠĠĠĠĠĠĠ ĠstartActivity ( intent t ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ }