package Ġcom . j rod rig ue z va . rick and mort y kotlin . ui . main Ċ Ċ import Ġandroid . os . Bundle Ċ import Ġandroidx . appcompat . app . AppCompatActivity Ċ import Ġandroidx . navigation . fragment . Nav Host Fragment Ċ import Ġandroidx . navigation . ui . Navigation UI Ċ import Ġandroidx . navigation . ui . setup With Nav Controller Ċ import Ġcom . j rod rig ue z va . rick and mort y kotlin . R Ċ import Ġcom . j rod rig ue z va . rick and mort y kotlin . databinding . MainActivity Binding Ċ import Ġcom . j rod rig ue z va . rick and mort y kotlin . utils . extensions . view Binding Ċ import Ġcom . j rod rig ue z va . rick and mort y kotlin . utils . extensions . visible Ċ import Ġdagger . h ilt . android . Android EntryPoint Ċ Ċ @ Android EntryPoint Ċ class ĠMainActivity Ġ: ĠAppCompatActivity () Ġ{ ĊĠĠĠ Ġprivate Ġval Ġbinding Ġby Ġview Binding ( MainActivity Binding :: inflate ) ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate ( savedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . onCreate ( savedInstanceState ) ĊĠĠĠĠĠĠĠ ĠsetContentView ( binding . root ) ĊĠĠĠĠĠĠĠ Ġsetup Views () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġsetup Views () Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġnav Host Fragment Ġ= Ġsupport FragmentManager . find Fragment ById ( R . id . nav _ host _ fragment ) Ġas ĠNav Host Fragment ĊĠĠĠĠĠĠĠ Ġval Ġnav Controller Ġ= Ġnav Host Fragment . nav Controller ĊĠĠĠĠĠĠĠ ĠNavigation UI . setup With Nav Controller ( binding . bottom Nav , Ġnav Host Fragment . nav Controller ) ĊĠĠĠĠĠĠĠ Ġbinding . bottom Nav . setup With Nav Controller ( nav Controller ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġvisibility Bottom Navigation ( visible : ĠBoolean ) Ġ{ ĊĠĠĠĠĠĠĠ Ġbinding . bottom Nav . visible Ġ= Ġvisible ĊĠĠĠ Ġ} Ċ } Ċ