package Ġcom . example . h obby fi . ui . main Ċ Ċ import Ġandroidx . fragment . app . activity ViewModels Ċ import Ġandroidx . navigation . nav Args Ċ import Ġandroidx . paging . Experimental Paging Api Ċ import Ġcom . example . h obby fi . ui . base . Base Fragment Ċ import Ġcom . example . h obby fi . view models . factories . Auth User ViewModel Factory Ċ import Ġcom . example . h obby fi . view models . main . MainActivity ViewModel Ċ import Ġkotlinx . coroutines . Experimental Cor outines Api Ċ Ċ @ Experimental Cor outines Api Ċ abstract Ġclass ĠMain Fragment Ġ: ĠBase Fragment () Ġ{ ĊĠĠĠ Ġprotected Ġval Ġactivity ViewModel : ĠMainActivity ViewModel Ġby Ġactivity ViewModels ( factory Producer Ġ= Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġactivity Ġ= Ġactivity Ġas ĠMainActivity ĊĊĠĠĠĠĠĠĠ Ġreturn @ activity ViewModels Ġif ( activity . intent . extras Ġ!= Ġnull ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ Ġval Ġactivity Args : ĠMainActivity Args Ġby Ġactivity . nav Args () ĊĠĠĠĠĠĠĠĠĠĠĠ ĠAuth User ViewModel Factory ( require Activity (). application , Ġactivity Args . user ) ĊĠĠĠĠĠĠĠ Ġ} Ġelse ĠAuth User ViewModel Factory ( require Activity (). application , Ġnull ) ĊĠĠĠ Ġ}) Ċ }