mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
Decouple SettingsScreen from UiViewModel (#3137)
This commit is contained in:
parent
48da34ce1a
commit
eedc3ef963
7 changed files with 364 additions and 251 deletions
|
|
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue