Decouple SettingsScreen from UiViewModel (#3137)

This commit is contained in:
Phil Oliver 2025-09-18 07:40:33 -04:00 committed by GitHub
parent 48da34ce1a
commit eedc3ef963
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 364 additions and 251 deletions

View file

@ -106,16 +106,16 @@ class MainActivity :
SideEffect { AppCompatDelegate.setDefaultNightMode(theme) }
}
val showAppIntro by model.showAppIntro.collectAsStateWithLifecycle()
if (showAppIntro) {
val appIntroCompleted by model.appIntroCompleted.collectAsStateWithLifecycle()
if (appIntroCompleted) {
MainScreen(uIViewModel = model, bluetoothViewModel = bluetoothViewModel)
} else {
AppIntroductionScreen(
onDone = {
model.onAppIntroCompleted()
(application as GeeksvilleApplication).askToRate(this@MainActivity)
},
)
} else {
MainScreen(uIViewModel = model, bluetoothViewModel = bluetoothViewModel)
}
}
}