package Ġcom . random apps inc . cat pix . activities Ċ Ċ import Ġandroid . os . Bundle Ċ import Ġandroidx . annotation . Id Res Ċ import Ġandroidx . appcompat . app . AppCompatActivity Ċ import Ġcom . jo anz ap ata . icon ify . Icon ify Ċ import Ġcom . jo anz ap ata . icon ify . fonts . Ion icons Module Ċ import Ġcom . random apps inc . cat pix . R Ċ import Ġcom . random apps inc . cat pix . fragments . Homepage Fragment Controller Ċ import Ġcom . random apps inc . cat pix . persistence . Preferences Manager Ċ import Ġcom . random apps inc . cat pix . persistence . database . F avorites DataManager Ċ import Ġcom . random apps inc . cat pix . utils . show Homepage Dialog Ċ import Ġcom . random apps inc . cat pix . views . Bottom Navigation View Ċ Ċ class ĠMainActivity Ġ: ĠAppCompatActivity (), ĠBottom Navigation View . Listener Ġ{ ĊĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġbottom Navigation : ĠBottom Navigation View ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġnavigation Controller : ĠHome page Fragment Controller ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate ( savedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . onCreate ( savedInstanceState ) ĊĠĠĠĠĠĠĠ ĠIcon ify . with ( Ion icons Module ()) ĊĠĠĠĠĠĠĠ ĠF avorites DataManager . instance . initialize ( this ) ĊĠĠĠĠĠĠĠ ĠsetContentView ( R . layout . activity _ main ) ĊĊĠĠĠĠĠĠĠ Ġbottom Navigation Ġ= ĠfindViewById ( R . id . bottom _ navigation ) ĊĊĠĠĠĠĠĠĠ ĠPreferences Manager ( this ). log App Open () ĊĠĠĠĠĠĠĠ Ġshow Homepage Dialog ( this ) ĊĊĠĠĠĠĠĠĠ Ġnavigation Controller Ġ= ĠHome page Fragment Controller ( support FragmentManager , ĠR . id . container ) ĊĠĠĠĠĠĠĠ Ġbottom Navigation . set Listener ( this ) ĊĠĠĠĠĠĠĠ Ġnavigation Controller . load Home () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Nav ItemSelected (@ Id Res Ġview Id : ĠInt ) Ġ{ ĊĠĠĠĠĠĠĠ Ġnavigation Controller . on Nav ItemSelected ( view Id ) ĊĠĠĠĠĠĠĠ Ġwhen Ġ( view Id ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠR . id . home Ġ-> ĠsetTitle ( R . string . app _ name ) ĊĠĠĠĠĠĠĠĠĠĠĠ ĠR . id . favorites Ġ-> ĠsetTitle ( R . string . favorites ) ĊĠĠĠĠĠĠĠĠĠĠĠ ĠR . id . settings Ġ-> ĠsetTitle ( R . string . settings ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ } Ċ