package Ġcom . bat dem ir . template . ui . view Ċ Ċ import Ġandroid . os . Bundle Ċ import Ġandroidx . navigation . find Nav Controller Ċ import Ġandroidx . navigation . fragment . Nav Host Fragment Ċ import Ġandroidx . navigation . ui . AppBar Configuration Ċ import Ġandroidx . navigation . ui . setup With Nav Controller Ċ import Ġcom . bat dem ir . template . R Ċ import Ġcom . bat dem ir . template . app . My Application Ċ import Ġcom . bat dem ir . template . databinding . Activity Main Binding Ċ import Ġcom . bat dem ir . template . di . component . Github Component Ċ import Ġcom . bat dem ir . template . di . component . Home Component Ċ import Ġcom . bat dem ir . template . di . component . Settings Component Ċ import Ġcom . bat dem ir . template . di . component . Stack Over Flow Component Ċ import Ġcom . bat dem ir . template . ui . base . view . Base Activity Ċ Ċ class ĠMainActivity Ġ: ĊĠĠĠ ĠBase Activity < Activity Main Binding , ĠMain ViewModel >( R . layout . activity _ main ) Ġ{ ĊĠĠĠ Ġlateinit Ġvar Ġhome Component : ĠHome Component ĊĠĠĠ Ġlateinit Ġvar Ġstack Over Flow Component : ĠStack Over Flow Component ĊĠĠĠ Ġlateinit Ġvar Ġgithub Component : ĠGithub Component ĊĠĠĠ Ġlateinit Ġvar Ġsettings Component : ĠSettings Component ĊĊĠĠĠ Ġoverride Ġfun Ġon Support Navigate Up (): ĠBoolean Ġ= Ġfind Nav Controller ( R . id . navigation _ host _ fragment ). navigate Up () ĊĊĠĠĠ Ġoverride Ġfun Ġon Back Pressed () Ġ{ ĊĠĠĠĠĠĠĠ Ġif Ġ(! on Support Navigate Up ()) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġsuper . on Back Pressed () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġinject () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġapplication Component Ġ= Ġ( application Ġas ĠMy Application ). application Component ĊĠĠĠĠĠĠĠ Ġapplication Component . inject ( this ) ĊĠĠĠĠĠĠĠ Ġhome Component Ġ= Ġapplication Component . home Component (). create () ĊĠĠĠĠĠĠĠ Ġstack Over Flow Component Ġ= Ġapplication Component . stack Over Flow Component (). create () ĊĠĠĠĠĠĠĠ Ġgithub Component Ġ= Ġapplication Component . github Component (). create () ĊĠĠĠĠĠĠĠ Ġsettings Component Ġ= Ġapplication Component . settings Component (). create () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġsetup Definition ( savedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġtoolbar Ġ= Ġget Binding (). toolbar ĊĠĠĠĠĠĠĠ Ġval Ġbottom Navigation View Ġ= Ġget Binding (). bottom Navigation View ĊĠĠĠĠĠĠĠ Ġval Ġnav Host Fragment Ġ= ĊĠĠĠĠĠĠĠĠĠĠĠ Ġsupport FragmentManager . find Fragment ById ( R . id . navigation _ host _ fragment ) Ġas ĠNav Host Fragment ĊĠĠĠĠĠĠĠ Ġval Ġnav Controller Ġ= Ġnav Host Fragment . nav Controller ĊĠĠĠĠĠĠĠ Ġval Ġapp Bar Configuration Ġ= ĠApp Bar Configuration ( nav Controller . graph ) ĊĠĠĠĠĠĠĠ Ġset Support ActionBar ( toolbar ) ĊĠĠĠĠĠĠĠ Ġtoolbar . setup With Nav Controller ( nav Controller , Ġapp Bar Configuration ) ĊĠĠĠĠĠĠĠ Ġbottom Navigation View . setup With Nav Controller ( nav Controller ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġsetup Listener () Ġ{ ĊĠĠĠĠĠĠĠ Ġ// (" Not Ġyet Ġimplemented ") ĊĠĠĠ Ġ} Ċ }