package Ġcom . example . antic ov id . ui . main Ċ Ċ import Ġandroidx . lifecycle . LiveData Ċ import Ġandroidx . lifecycle . Mutable LiveData Ċ import Ġandroidx . lifecycle . ViewModel Ċ import Ġcom . example . antic ov id . data . repository . Login Repository Ċ Ċ class ĠMain ViewModel Ġ: ĠViewModel () Ġ{ ĊĊĠĠĠ Ġprivate Ġval Ġlogin Repository Ġ= ĠLogin Repository () ĊĊĠĠĠ Ġprivate Ġval Ġ_ main Fragment Enum Ġ= ĠMutable LiveData < Main Fragment Enum >() ĊĠĠĠ Ġval Ġmain Fragment Enum : ĠLive Data < Main Fragment Enum > Ġ= Ġ_ main Fragment Enum ĊĊĠĠĠ Ġprivate Ġval Ġ_ is User Signed In Ġ= ĠMutable LiveData < Boolean >() ĊĠĠĠ Ġval Ġis User Signed In : ĠLive Data < Boolean > Ġ= Ġ_ is User Signed In ĊĊĠĠĠ Ġinit Ġ{ ĊĠĠĠĠĠĠĠ Ġ_ is User Signed In . value Ġ= Ġlogin Repository . is User Signed In () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġon Fragment Switch ( selected Fragment : ĠMain Fragment Enum ) Ġ{ ĊĠĠĠĠĠĠĠ Ġ_ main Fragment Enum . value Ġ= Ġselected Fragment ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġsign Out () Ġ{ ĊĠĠĠĠĠĠĠ Ġlogin Repository . sign Out () ĊĠĠĠĠĠĠĠ Ġ_ is User Signed In . value Ġ= Ġfalse ĊĠĠĠ Ġ} Ċ }