package Ġcom . s ule y man cel ik . github Ċ Ċ import Ġandroid . os . Bundle Ċ import Ġandroidx . navigation . find Nav Controller Ċ import Ġandroidx . navigation . ui . AppBar Configuration Ċ import Ġandroidx . navigation . ui . setup ActionBar With Nav Controller Ċ import Ġcom . s ule y man cel ik . github . common . ui . view Binding Ċ import Ġcom . s ule y man cel ik . github . databinding . Activity Main Binding Ċ import Ġdagger . android . support . D agger AppCompatActivity Ċ Ċ class ĠMainActivity Ġ: ĠD agger AppCompatActivity () Ġ{ ĊĊĠĠĠ Ġprivate Ġval Ġmain Activity Binding Ġby Ġview Binding ( Activity Main Binding :: inflate ) ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate ( savedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . onCreate ( savedInstanceState ) ĊĠĠĠĠĠĠĠ ĠsetContentView ( main Activity Binding . root ) ĊĠĠĠĠĠĠĠ Ġprepare Navigation () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon Support Navigate Up (): ĠBoolean Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġnav Controller Ġ= Ġfind Nav Controller ( R . id . nav _ host _ fragment ) ĊĠĠĠĠĠĠĠ Ġreturn Ġnav Controller . navigate Up () Ġ|| Ġsuper . on Support Navigate Up () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġprepare Navigation () Ġ{ ĊĠĠĠĠĠĠĠ Ġset Support ActionBar ( main Activity Binding . toolbar ) ĊĠĠĠĠĠĠĠ Ġval Ġnav Controller Ġ= Ġfind Nav Controller ( R . id . nav _ host _ fragment ) ĊĠĠĠĠĠĠĠ Ġval Ġapp Bar Configuration Ġ= ĠApp Bar Configuration ( ĊĠĠĠĠĠĠĠĠĠĠĠ Ġset Of ( R . id . navigation _ home ) ĊĠĠĠĠĠĠĠ Ġ) ĊĠĠĠĠĠĠĠ Ġsetup ActionBar With Nav Controller ( nav Controller , Ġapp Bar Configuration ) ĊĠĠĠ Ġ} Ċ }