package Ġcom . and hir at ob ing . movie app . presentation . fragments . home Ċ Ċ import Ġandroid . os . Bundle Ċ import Ġandroid . view . View Ċ import Ġandroidx . fragment . app . Fragment Ċ import Ġcom . and hir at ob ing . movie app . R Ċ import Ġcom . and hir at ob ing . movie app . databinding . Fragment Home Binding Ċ import Ġcom . and hir at ob ing . movie app . presentation . fragments . home . adapters . Home Section Page Adapter Ċ import Ġcom . google . android . material . tabs . Tab Layout Mediator Ċ import Ġdagger . h ilt . android . Android EntryPoint Ċ Ċ @ Android EntryPoint Ċ class ĠHome Fragment Ġ: ĠFragment ( R . layout . fragment _ home ) Ġ{ ĊĊĠĠĠ Ġprivate Ġvar Ġ_ binding Home Fragment : ĠFragment Home Binding ? Ġ= Ġnull ĊĠĠĠ Ġprivate Ġval Ġbinding Home Fragment Ġget () Ġ= Ġ_ binding Home Fragment Ġas ĠFragment Home Binding ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġhome Section Page Adapter : ĠHome Section Page Adapter ĊĊĠĠĠ Ġoverride Ġfun Ġon View Created ( view : ĠView , ĠsavedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . on View Created ( view , ĠsavedInstanceState ) ĊĠĠĠĠĠĠĠ Ġ_ binding Home Fragment Ġ= ĠFragment Home Binding . bind ( view ) ĊĊĠĠĠĠĠĠĠ Ġset Tab Layout Adapter () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġfun Ġset Tab Layout Adapter () Ġ{ ĊĠĠĠĠĠĠĠ Ġbinding Home Fragment . apply Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġhome Section Page Adapter Ġ= ĠHome Section Page Adapter ( parent FragmentManager , Ġlifecycle ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġview Pager . adapter Ġ= Ġhome Section Page Adapter ĊĊĠĠĠĠĠĠĠĠĠĠĠ ĠTab Layout Mediator ( tab Layout , Ġview Pager ) Ġ{ Ġtab , Ġposition Ġ-> ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġwhen ( position ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ 0 Ġ-> Ġtab . text Ġ= Ġresources . getString ( R . string . tab _ movie ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ 1 Ġ-> Ġtab . text Ġ= Ġresources . getString ( R . string . tab _ tv _ shows ) ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ}. attach () ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĊĊĠĠĠ Ġoverride Ġfun Ġon Destroy View () Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . on Destroy View () ĊĠĠĠĠĠĠĠ Ġ_ binding Home Fragment Ġ= Ġnull ĊĠĠĠ Ġ} Ċ }