Petru
09/18/2024, 9:35 AMisSystemInDarkTheme
should return
• the status of the device theme set in device settings or
• the status of the app theme (set through AppCompatDelegate.setDefaultNightMode...
) ?
I see the latter, which I would expect
(Compose cares about rendering in the app and the app has a different theme so that should be used instead of the system's)
but the method name is a bit confusing then.
Maybe Android being able to set it's own theme through AppCompatDelegate.setDefaultNightMode(..)
is an edgecase which is not accounted in that method's naming?Stylianos Gakis
09/18/2024, 9:55 AMAppCompatDelegate.setDefaultNightMode
.
Do you want to be able to get the system's theme decision even if the user has made another decision in the app itself for some reason?Petru
09/18/2024, 10:08 AMUiModeManager
to get the actual system theme.
Wanted to confirm that that methods does what it should
(return app's theme not the system one's)
and then maybe propose to have it's name/documentation updated.Stylianos Gakis
09/18/2024, 10:15 AMUiModeManager
, I do realize that when we get a theme selection from the user, we do explicitly give that information to UiModeManager too https://github.com/HedvigInsurance/android/blob/e8a5047f022b70022ea0f08d9708a5977f[…]/app/app/src/main/kotlin/com/hedvig/android/app/MainActivity.kt but I don't quite remember 100% why I made this change.
I think something regarding the theme being right on app startup while the splash screen was showing still before we get a chance to evaluate anything else. But in any case, setting AppCompatDelegate.setDefaultNightMode
did not automatically also set it for UiModeManager
Petru
09/18/2024, 11:00 AMUIModeManager
trick to get the right background for the splashscreen, is it okay if I borrow it?)Stylianos Gakis
09/18/2024, 11:01 AM