package Ġcom . ham i . sport s _ assist . settings Ċ Ċ import Ġandroid . content . Context Ċ import Ġandroidx . lifecycle .* Ċ import Ġcom . ham i . sport s _ assist . Exception Helper . nb a ExceptionHandler Ċ import Ġcom . ham i . sport s _ assist . data . N ba Stat Repository Ċ import Ġcom . ham i . sport s _ assist . data . N ba Team Repository Ċ import Ġcom . ham i . sport s _ assist . data . local . AppSettings Ċ import Ġdagger . h ilt . android . lifecycle . H ilt ViewModel Ċ import Ġkotlinx . coroutines . Dispatch ers Ċ import Ġkotlinx . coroutines . flow . map Ċ import Ġkotlinx . coroutines . launch Ċ import Ġjavax . inject . Inject Ċ Ċ @ H ilt ViewModel Ċ class ĠSettings ViewModel Ġ@ Inject Ġconstructor ( ĊĠĠĠ Ġprivate Ġval Ġn ba Team Repository : ĠN ba Team Repository , ĊĠĠĠ Ġprivate Ġval Ġn ba Stat Repository : ĠN ba Stat Repository Ċ ) Ġ: ĠViewModel () Ġ{ ĊĠĠĠ Ġval Ġteam Banner : ĠLive Data < String > Ġ= ĊĠĠĠĠĠĠĠ Ġn ba Team Repository . get Team Detail Flow () ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. map Ġ{ Ġit . banner Url Ġ} ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ. as LiveData ( viewModel Scope . coroutine Context ) ĊĊĠĠĠ Ġval Ġschedule Week s Setting Changed : ĠMutable LiveData < Boolean > Ġ= ĠMutable LiveData () ĊĊĠĠĠ Ġval Ġstart From Monday Setting Changed : ĠMutable LiveData < Boolean > Ġ= ĠMutable LiveData () ĊĊĠĠĠ Ġinit Ġ{ ĊĠĠĠĠĠĠĠ Ġschedule Week s Setting Changed . value Ġ= ĠApp Settings . has Schedule Week s Setting Changed () ĊĠĠĠĠĠĠĠ Ġstart From Monday Setting Changed . value Ġ= ĠApp Settings . has Week Start From Monday Setting Changed () ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġswitch Team ( context : ĠContext , Ġteam : ĠString ) Ġ{ ĊĠĠĠĠĠĠĠ ĠviewModel Scope . launch ( Dispatch ers . IO Ġ+ Ġn ba ExceptionHandler ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠApp Settings . set N ba Team ( context , Ġteam ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġreload All () ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġset Schedule Week s ( context : ĠContext , Ġweeks : ĠInt ) Ġ{ ĊĠĠĠĠĠĠĠ ĠviewModel Scope . launch ( Dispatch ers . IO Ġ+ Ġn ba ExceptionHandler ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠApp Settings . set Schedule Week s ( context , Ġweeks ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġschedule Week s Setting Changed . post Value ( AppSettings . has Schedule Week s Setting Changed ()) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġfun Ġset Week Start From Monday ( context : ĠContext , Ġis Start From Monday : ĠBoolean ) Ġ{ ĊĠĠĠĠĠĠĠ ĠviewModel Scope . launch ( Dispatch ers . IO Ġ+ Ġn ba ExceptionHandler ) Ġ{ ĊĠĠĠĠĠĠĠĠĠĠĠ ĠApp Settings . set Start From Monday ( context , Ġis Start From Monday ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġstart From Monday Setting Changed . post Value ( AppSettings . has Week Start From Monday Setting Changed ()) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġprivate Ġsuspend Ġfun Ġreload All () Ġ{ ĊĠĠĠĠĠĠĠ Ġn ba Team Repository . fetch Team Detail From Backend ( AppSettings . my N ba Team ) ĊĠĠĠĠĠĠĠ Ġn ba Team Repository . fetch Season Status From Backend () ĊĠĠĠĠĠĠĠ Ġn ba Stat Repository . fetch Team Schedule From Backend ( AppSettings . my N ba Team ) ĊĠĠĠĠĠĠĠ Ġn ba Stat Repository . fetch Stand ing From Backend () ĊĠĠĠĠĠĠĠ Ġn ba Stat Repository . fetch Post Season From Backend () ĊĠĠĠ Ġ} Ċ }