package Ġcom . test . tri bal . ui . main screen Ċ Ċ import Ġandroid . os . Bundle Ċ import Ġandroid . view . Menu Ċ import Ġcom . google . android . material . sn ackbar . Snackbar Ċ import Ġcom . google . android . material . navigation . Navigation View Ċ import Ġandroidx . navigation . find Nav Controller Ċ import Ġandroidx . navigation . ui . AppBar Configuration Ċ import Ġandroidx . navigation . ui . navigate Up Ċ import Ġandroidx . navigation . ui . setup ActionBar With Nav Controller Ċ import Ġandroidx . navigation . ui . setup With Nav Controller Ċ import Ġandroidx . drawer layout . widget . Drawer Layout Ċ import Ġandroidx . appcompat . app . AppCompatActivity Ċ import Ġcom . test . tri bal . R Ċ import Ġcom . test . tri bal . databinding . Activity Home Binding Ċ import Ġcom . test . tri bal . ui . base . Activity Base Ċ Ċ class ĠHome Activity Ġ: ĠActivity Base () Ġ{ ĊĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġapp Bar Configuration : ĠApp Bar Configuration ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġbinding : ĠActivity Home Binding ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate ( savedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . onCreate ( savedInstanceState ) ĊĊĠĠĠĠĠĠĠ Ġbinding Ġ= ĠActivity Home Binding . inflate ( layout Inflater ) ĊĠĠĠĠĠĠĠ ĠsetContentView ( binding . root ) ĊĊĠĠĠĠĠĠĠ Ġset Support ActionBar ( binding . app Bar Home . toolbar ) ĊĊĠĠĠĠĠĠĠ Ġval Ġdrawer Layout : ĠDraw er Layout Ġ= Ġbinding . drawer Layout ĊĠĠĠĠĠĠĠ Ġval Ġnav View : ĠNavigation View Ġ= Ġbinding . nav View ĊĠĠĠĠĠĠĠ Ġval Ġnav Controller Ġ= Ġfind Nav Controller ( R . id . nav _ host _ fragment _ content _ home ) ĊĠĠĠĠĠĠĠ Ġ// ĠPass ing Ġeach Ġmenu ĠID Ġas Ġa Ġset Ġof ĠI ds Ġbecause Ġeach ĊĠĠĠĠĠĠĠ Ġ// Ġmenu Ġshould Ġbe Ġconsidered Ġas Ġtop Ġlevel Ġdest inations . ĊĠĠĠĠĠĠĠ Ġapp Bar Configuration Ġ= ĠApp Bar Configuration ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġset Of ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ), Ġdrawer Layout ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġsetup ActionBar With Nav Controller ( nav Controller , Ġapp Bar Configuration ) ĊĠĠĠĠĠĠĠ Ġnav View . setup With Nav Controller ( nav Controller ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Support Navigate Up (): ĠBoolean Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġnav Controller Ġ= Ġfind Nav Controller ( R . id . nav _ host _ fragment _ content _ home ) ĊĠĠĠĠĠĠĠ Ġreturn Ġnav Controller . navigate Up ( app Bar Configuration ) Ġ|| Ġsuper . on Support Navigate Up () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġset Listeners () Ġ{ ĊĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġset Observer s () Ġ{ ĊĊĠĠĠ Ġ} Ċ }