Ewan
09/17/2022, 10:44 AMWindowCompat.setDecorFitsSystemWindows(window, false)
setContent {
val systemUiController: SystemUiController = rememberSystemUiController()
systemUiController.isStatusBarVisible = false
// draw here
The layout inspector shows a ViewStub of height 42dp:
DecorView
LinearLayout
action_mode_bar_stub - ViewStub height 42dp
content - FrameLayout
ComposeView
navigationBarBackground - View
statusBarBackground - View
Any ideas ?
UPDATE: I've found it draws correctly on an Android 12 & 13 emulators but not on Android 12 on a Samsung S10.Stylianos Gakis
09/17/2022, 12:11 PMisStatusBarVisible
part, simply by doing WindowCompat.setDecorFitsSystemWindows(window, false)
. Maybe take a look at how NiA does it?
Take a look at the theme and maybe the values-v27 (and v23) one?Ewan
09/19/2022, 2:03 PMWindowCompat.setDecorFitsSystemWindows(window, false)
setContentView(R.layout.activity_main)
findViewById<View>(R.id.my_view)?.let {
val controller = WindowCompat.getInsetsController(window, it.rootView)
controller.systemBarsBehavior = WindowInsetsControllerCompat.BEHAVIOR_SHOW_BARS_BY_SWIPE
it.setOnClickListener { controller.hide(WindowInsetsCompat.Type.systemBars()) }
}
Stylianos Gakis
09/19/2022, 2:14 PMAlex Vanyo
09/19/2022, 4:28 PMlayoutInDisplayCutoutMode
Ewan
09/19/2022, 6:07 PM<item name="android:windowLayoutInDisplayCutoutMode">
shortEdges <!-- default, shortEdges, or never -->
</item>
and working with & without compose. 🙂