package Ġorg . ion project . android . offline . catalog Term Files Ċ Ċ import Ġandroid . os . Bundle Ċ import Ġandroid . view . LayoutInflater Ċ import Ġandroid . view . View Ċ import Ġandroid . view . ViewGroup Ċ import Ġandroidx . fragment . app . activity ViewModels Ċ import Ġandroidx . navigation . fragment . find Nav Controller Ċ import Ġkotlinx . android . synt hetic . main . fragment _ catalog _ term _ files . view .* Ċ import Ġorg . ion project . android . Exception Handling Fragment Ċ import Ġorg . ion project . android . R Ċ import Ġorg . ion project . android . offline . Catalog Shared ViewModel Ċ import Ġorg . ion project . android . offline . Catalog Shared ViewModel Provider Ċ import Ġjava . util .* Ċ Ċ class ĠCatalog Term Files Fragment Ġ: ĠException Handling Fragment () Ġ{ ĊĊĠĠĠ Ġ/** ĊĠĠĠĠ Ġ* ĠThis Ġview Ġmodel Ġis Ġshared Ġbetween Ġfragments Ġand Ġthe ĠMainActivity ĊĠĠĠĠ Ġ*/ ĊĠĠĠ Ġprivate Ġval Ġshared ViewModel : ĠCatalog Shared ViewModel Ġby Ġactivity ViewModels Ġ{ ĊĠĠĠĠĠĠĠ ĠCatalog Shared ViewModel Provider () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun ĠonCreate View ( ĊĠĠĠĠĠĠĠ Ġinflater : ĠLayoutInflater , Ġcontainer : ĠViewGroup ?, ĊĠĠĠĠĠĠĠ ĠsavedInstanceState : ĠBundle ? ĊĠĠĠ Ġ): ĠView ? Ġ{ ĊĠĠĠĠĠĠĠ Ġ// ĠInf late Ġthe Ġlayout Ġfor Ġthis Ġfragment ĊĠĠĠĠĠĠĠ Ġreturn Ġinflater . inflate ( R . layout . fragment _ catalog _ term _ files , Ġcontainer , Ġfalse ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġon View Created ( view : ĠView , ĠsavedInstanceState : ĠBundle ?) Ġ{ ĊĠĠĠĠĠĠĠ Ġsuper . on View Created ( view , ĠsavedInstanceState ) ĊĊĠĠĠĠĠĠĠ Ġval Ġnav Controller Ġ= Ġfind Nav Controller () ĊĊĠĠĠĠĠĠĠ Ġval Ġprogram me Ġ= Ġshared ViewModel . selected Catalog Program me ?. program me Name Ġ?: Ġ"" ĊĊĠĠĠĠĠĠĠ Ġval Ġterm Ġ= Ġshared ViewModel . selected Catalog Program me Term ĊĊĠĠĠĠĠĠĠ Ġview . text view _ catalog _ term _ files _ program me . text Ġ= Ġprogram me . toUpperCase ( Locale . ROOT ) ĊĊĠĠĠĠĠĠĠ Ġview . text view _ catalog _ term _ files _ term . text Ġ= Ġterm ĊĊĠĠĠĠĠĠĠ Ġview . button _ catalog _ term _ files _ exam . setOnClickListener Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġnav Controller . navigate ( R . id . action _ catalog _ term _ files _ to _ catalog Exam Schedule Fragment ) ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġview . button _ catalog _ term _ files _ timetable . setOnClickListener Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġnav Controller . navigate ( R . id . action _ catalog _ term _ files _ to _ catalog _ timetable ) ĊĠĠĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠĠĠ Ġview . button _ catalog _ term _ files _ calendar . setOnClickListener Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġnav Controller . navigate ( R . id . action _ catalog _ term _ files _ to _ catalog _ calendar ) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} Ċ }