I\'m trying to support the Android Q Dark theme for my Android app and I can\'t figure out how to import different assets based on the theme I\'m currently in.
Im using
You first need to do this changes in manifest
then onConfigurationChanged of activity
val currentNightMode = resources.configuration.uiMode and Configuration.UI_MODE_NIGHT_MASK
when (currentNightMode) {
Configuration.UI_MODE_NIGHT_NO -> {} // Night mode is not active, we're using the light theme
Configuration.UI_MODE_NIGHT_YES -> {} // Night mode is active, we're using dark theme
}