package Ġcom . example . gd sc _ hack athon . fragments . weekly Time Table Ċ Ċ import Ġandroid . os . Bundle Ċ import Ġandroidx . fragment . app . Fragment Ċ import Ġandroid . view . LayoutInflater Ċ import Ġandroid . view . View Ċ import Ġandroid . view . ViewGroup Ċ import Ġandroidx . view pager . widget . ViewPager Ċ import Ġcom . example . gd sc _ hack athon . R Ċ import Ġcom . example . gd sc _ hack athon . fragments . weekly Time Table . third _ sem .* Ċ import Ġcom . google . android . material . tabs . Tab Layout Ċ Ċ class ĠWeek ly Time Table Fragment Ġ: ĠFragment () Ġ{ ĊĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġ Ġfragment Third Sem Time Table A ViewPager Adapter : ĠFragment Third Sem Time Table A ViewPager Adapter ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġ Ġview Pager : ĠView Pager ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġ Ġtab Layout : ĠTab Layout ĊĠĠĠĠĊĠĠĠ Ġoverride Ġfun ĠonCreate View ( ĊĠĠĠĠĠĠĠ Ġinflater : ĠLayoutInflater , Ġcontainer : ĠViewGroup ?, ĊĠĠĠĠĠĠĠ ĠsavedInstanceState : ĠBundle ? ĊĠĠĠ Ġ): ĠView ? Ġ{ ĊĠĠĠĠĠĠĠ Ġ// ĠInf late Ġthe Ġlayout Ġfor Ġthis Ġfragment ĊĠĠĠĠĠĠĠ Ġval Ġroot View Ġ= Ġ Ġinflater . inflate ( R . layout . fragment _ weekly _ time _ table , Ġcontainer , Ġfalse ) ĊĊĠĠĠĠĠĠĠ Ġview Pager Ġ= Ġroot View . findViewById ( R . id . tab _ view pager ) ĊĊĠĠĠĠĠĠĠ Ġfragment Third Sem Time Table A ViewPager Adapter Ġ= ĠFragment Third Sem Time Table A ViewPager Adapter ( child FragmentManager ) ĊĊĠĠĠĠĠĠĠ Ġfragment Third Sem Time Table A ViewPager Adapter . add ( Fragment Third Sem Monday Time Table (), Ġ" Monday ") ĊĠĠĠĠĠĠĠ Ġfragment Third Sem Time Table A ViewPager Adapter . add ( Fragment Third Sem Tuesday Time Table (), Ġ" Tuesday ") ĊĠĠĠĠĠĠĠ Ġfragment Third Sem Time Table A ViewPager Adapter . add ( Fragment Third Sem Wednesday Time Table (), Ġ" Wednesday ") ĊĠĠĠĠĠĠĠ Ġfragment Third Sem Time Table A ViewPager Adapter . add ( Fragment Third Sem Thursday Time Table (), Ġ" Thursday ") ĊĠĠĠĠĠĠĠ Ġfragment Third Sem Time Table A ViewPager Adapter . add ( Fragment Third Sem Friday Time Table (), Ġ" Friday ") ĊĊĠĠĠĠĠĠĠ Ġview Pager . adapter Ġ= Ġfragment Third Sem Time Table A ViewPager Adapter ĊĊĠĠĠĠĠĠĠ Ġtab Layout Ġ= Ġroot View . findViewById ( R . id . tab _ layout ) ĊĠĠĠĠĠĠĠ Ġtab Layout . setup With ViewPager ( view Pager ) ĊĠĠĠĠĠĠĠ Ġreturn Ġroot View ĊĠĠĠ Ġ} Ċ }