I'm learning the use of Material3 in jetpack compose, and I'm trying to set the statusbar to be transparent just as I used to. However, with the following code:
WindowCompat.setDecorFitsSystemWindows(window, false)
setContent {
val systemUiController = rememberSystemUiController()
SideEffect {
systemUiController.setSystemBarsColor(
color = Color.Transparent,
darkIcons = true
)
}
TestStatusBarTheme {
Surface(
modifier = Modifier
.statusBarsPadding()
.fillMaxSize(),
color = MaterialTheme.colorscheme.background
) {
Text(text = "Test")
}
}
}
While navigationbar becomes transparent, statusbar does not change anyway. Then I apply the same code, this time using original material design library while keeping everything else unchanged, and it works properly, as the statusbar turns into transparent too.
I can't figure out why I can't use accompanist to change the statusbar in material3. As navigationbar becomes transparent, it's obvious that the systemUiController has got the window and can make changes to navigationbar, then why it can't work with statusbar, which also is a systembar? Is there anything new I haven't notice to make accompanist-systemuicontroller cooperate with Material3, or is it just an unfixed bug for the current version of Material3 or accompanist?
My compose version is 1.2.0-beta02, accompanist version is 0.24.9-beta, and material3 version is 1.0.0-alpha12.