[#11] Add a small delay before applying theme so compose has enough time to update remember states before the theme is applied.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2023-01-22 20:45:45 +01:00
parent 9ca830a707
commit f40b66077b

View File

@@ -94,7 +94,11 @@ class MainActivity : AppCompatActivity(), ISettingsChangeListener {
}
if (themeValue != AppCompatDelegate.getDefaultNightMode()) {
AppCompatDelegate.setDefaultNightMode(themeValue)
lifecycleScope.launch {
// Give compose a bit of time to update the state.
delay(50)
AppCompatDelegate.setDefaultNightMode(themeValue)
}
}
}