Splash screen generated by OS doesn't paint in black when OS dark theme is enabled. Has anyone disscovered how to solve this? It should be dark, not white, like almost everything in dark theme.
To clarify, I'm not talking about a custom splash developed with Splash API, I'm talking about the default and automatic splash that the OS adds to your app. For some reason, is ignoring dark theme, and as it is generated and managed by the OS, it should be dark.
Is there any way to solve this?
This is my onCreate:
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
enableEdgeToEdge()
setContent {
AppTheme {
Surface(modifier = Modifier.fillMaxSize()) {
App(modifier = Modifier.safeDrawingPadding())
}
}
}
}
this is my AppTheme:
@Composable
fun AppTheme(
darkTheme: Boolean = isSystemInDarkTheme(),
content: @Composable() () -> Unit,
) {
val colorScheme = when {
darkTheme -> darkColorScheme
else -> lightColorScheme
}
MaterialTheme(
colorScheme = colorScheme,
content = content,
)
}
Splash screen generated by OS doesn't paint in black when OS dark theme is enabled. Has anyone disscovered how to solve this? It should be dark, not white, like almost everything in dark theme.
To clarify, I'm not talking about a custom splash developed with Splash API, I'm talking about the default and automatic splash that the OS adds to your app. For some reason, is ignoring dark theme, and as it is generated and managed by the OS, it should be dark.
Is there any way to solve this?
This is my onCreate:
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
enableEdgeToEdge()
setContent {
AppTheme {
Surface(modifier = Modifier.fillMaxSize()) {
App(modifier = Modifier.safeDrawingPadding())
}
}
}
}
this is my AppTheme:
@Composable
fun AppTheme(
darkTheme: Boolean = isSystemInDarkTheme(),
content: @Composable() () -> Unit,
) {
val colorScheme = when {
darkTheme -> darkColorScheme
else -> lightColorScheme
}
MaterialTheme(
colorScheme = colorScheme,
content = content,
)
}
Share
Improve this question
asked Mar 11 at 18:55
NullPointerExceptionNullPointerException
37.8k80 gold badges231 silver badges405 bronze badges
1 Answer
Reset to default 0I created a new theme.xml with "night" qualifier, and I wrote that app theme must extend from android:Theme.Material.NoActionBar
instead of android:Theme.Material.Light.NoActionBar
and now it works perfectly