package Ġcom . destruct o . s ush i . ui . preferences . settings Ċ Ċ import Ġandroid . os . Bundle Ċ import Ġandroid . view . LayoutInflater Ċ import Ġandroid . view . View Ċ import Ġandroid . view . ViewGroup Ċ import Ġandroidx . fragment . app . Fragment Ċ import Ġandroidx . navigation . Nav Controller Ċ import Ġandroidx . navigation . fragment . Nav Host Fragment Ċ import Ġcom . destruct o . s ush i . R Ċ import Ġcom . destruct o . s ush i . databinding . Fragment Settings Binding Ċ import Ġdagger . h ilt . android . Android EntryPoint Ċ Ċ @ Android EntryPoint Ċ class ĠSettings Fragment Ġ: ĠFragment (){ ĊĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġnav Host Fragment : ĠNav Host Fragment ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġnav Controller : ĠNav Controller ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġbinding : ĠFragment Settings Binding ĊĊĊĠĠĠ Ġoverride Ġfun ĠonCreate View ( ĊĠĠĠĠĠĠĠ Ġinflater : ĠLayoutInflater , Ġcontainer : ĠViewGroup ?, ĊĠĠĠĠĠĠĠ ĠsavedInstanceState : ĠBundle ? ĊĠĠĠ Ġ): ĠView Ġ{ ĊĠĠĠĠĠĠĠ Ġbinding Ġ= ĠFragment Settings Binding . inflate ( in flater , container , false ). apply Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġlifecycle Owner Ġ= Ġview Lifecycle Owner ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠ Ġnav Host Fragment Ġ= Ġchild FragmentManager . find Fragment ById ( R . id . nav _ host _ settings ) Ġas ĠNav Host Fragment ĊĠĠĠĠĠĠĠ Ġnav Controller Ġ= Ġnav Host Fragment . nav Controller ĊĊĠĠĠĠĠĠĠ Ġnav Controller . add On Destination Changed Listener Ġ{ Ġ_, Ġ_, Ġ_ Ġ-> ĊĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġreturn Ġbinding . root ĊĠĠĠ Ġ} ĊĊĊ Ċ }