package Ġcom . ui u ang . cloud knowledge . ui . fragment . movie Ċ Ċ import Ġandroid . os . Bundle Ċ import Ġandroidx . fragment . app . Fragment Ċ import Ġandroidx . lifecycle . Observer Ċ import Ġcom . ui u ang . cloud knowledge . R Ċ import Ġcom . ui u ang . cloud knowledge . app . base . Base Fragment Ċ import Ġcom . ui u ang . cloud knowledge . databinding . Fragment Movie Binding Ċ import Ġcom . ui u ang . cloud knowledge . ext . bind ViewPager 2 Ċ import Ġcom . ui u ang . cloud knowledge . ext . init Ċ import Ġcom . ui u ang . cloud knowledge . ext . set Ui Theme Ċ import Ġcom . ui u ang . cloud knowledge . view model . state . Home ViewModel Ċ import Ġkotlinx . android . synt hetic . main . fragment _ movie .* ĊĊ Ċ class ĠMovie Fragment Ġ: ĠBase Fragment < Home ViewModel , ĠFragment Movie Binding >() Ġ{ ĊĠĠĠ Ġ// fragment éĽĨåĲĪ ĊĠĠĠ Ġprivate Ġvar Ġfragments : ĠArrayList < Fragment > Ġ= Ġarray ListOf () ĊĊĠĠĠ Ġ// æłĩé¢ĺ éĽĨåĲĪ ĊĠĠĠ Ġprivate Ġvar Ġdata List : ĠArrayList < String > Ġ= Ġarray ListOf () ĊĠĠĠ Ġoverride Ġfun Ġlayout Id (): ĠInt Ġ= ĠR . layout . fragment _ movie ĊĊĠĠĠ Ġoverride Ġfun Ġinit View ( savedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġ// åĪĿå§ĭåĮĸ Ġtoolbar ĊĠĠĠĠĠĠĠ Ġtoolbar . run Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġinit (" çĶµ å½± ") ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġfragments . add ( Film Showing Fragment . newInstance ()) ĊĠĠĠĠĠĠĠ Ġfragments . add ( Film Com ing Fragment . newInstance ()) ĊĠĠĠĠĠĠĠ Ġval ĠstringArray Ġ= Ġm Activity . resources . getString Array ( R . array . movie _ title ) ĊĠĠĠĠĠĠĠ Ġdata List . addAll ( string Array ) ĊĊĠĠĠĠĠĠĠ Ġ// åĪĿå§ĭåĮĸ view pager 2 ĊĠĠĠĠĠĠĠ Ġview _ pager . init ( this , Ġfragments ) ĊĠĠĠĠĠĠĠ Ġ// åĪĿå§ĭåĮĸ Ġmagic _ indicator ĊĠĠĠĠĠĠĠ Ġmagic Indicator . bind ViewPager 2 ( view _ pager , Ġm String List Ġ= Ġdata List ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġcreate Observer () Ġ{ ĊĠĠĠĠĠĠĠ Ġapp ViewModel . app Color . observe ( view Lifecycle Owner , ĠObserver Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ// çĽĳåĲ¬ åħ¨å±Ģ çļĦ ä¸»é¢ĺ é¢ľèī² æĶ¹åıĺ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġset Ui Theme ( it , Ġtoolbar ) ĊĠĠĠĠĠĠĠ Ġ}) ĊĠĠĠ Ġ} ĊĊ Ċ }