I have upgraded Compose for my app from 1.0.0-alpha10
to current latest of 1.0.0-beta03
I want to layout my activity contents edge to edge, underneath system bars.
Among other things I have used the below code to tell the system this intent.
window?.run {
WindowCompat.setDecorFitsSystemWindows(this, false)
}
This has worked well in the previous Compose version, but it seems like beta03
(or may be an earlier version after alpha10
) started setting fitsSystemWindows
to true
and makes the above code ineffective. (Moving it below setContent { }
had no effect either)
In the Layout Explorer I can see the decorView
and its direct child LinearLayout
now has fitsSystemWindows = true
I have below code as a temp solution which works to get the expected behavior.
// code that used to work on alpha10
window?.run {
WindowCompat.setDecorFitsSystemWindows(this, false)
}
setContent {
MyApp()
}
// temp workaround for beta03
window?.decorView?.fitsSystemWindows = false
window?.decorView?.allViews?.forEach { view ->
view.fitsSystemWindows = false
}
This feels like I'm fighting against Compose for the desired result.
What is the "correct" way to tell Compose not to override fitsSystemWindows
?