I developed app and thought everything is right with full screen until I run it on huawei cloud debugging real devices and discovered it is not working there. I tried everything and don't see much about it anywhere.
It looks like I cannot get system bar space when running on landscape to disappear.
I can see similar behaviour on all huawei phones.
My original approach was like this:
val window = activity().window
val controller = WindowInsetsControllerCompat(window, view)
controller.systemBarsBehavior = BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE
controller.hide(systemBars())
Then I started trying anything I found on SO.
Added to theme:
<item name="android:windowNoTitle">true</item>
<item name="android:windowFullscreen">true</item>
Before setContentView in Activity onCreate added:
activity().requestWindowFeature(Window.FEATURE_NO_TITLE)
and bunch of other crazy or deprecated stuff like:
window.addFlags(FLAG_FULLSCREEN)
window.addFlags(FLAG_LAYOUT_IN_SCREEN)
window.addFlags(FLAG_LAYOUT_NO_LIMITS)
window.addFlags(FLAG_LAYOUT_IN_OVERSCAN)
window.decorView.systemUiVisibility =
SYSTEM_UI_FLAG_LAYOUT_STABLE or SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION or
SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN or SYSTEM_UI_FLAG_HIDE_NAVIGATION or
SYSTEM_UI_FLAG_FULLSCREEN or SYSTEM_UI_FLAG_IMMERSIVE
Edit: After some more evaluation it looks I actually have full screen right but that is "just" a space behind notch that for whatever reason doesn't match color of my application background. So I was playing also with themes if I cannot change some background color so I will change color of that notch background space.
This are my styles that doesn effect notch:
<item name="android:windowBackground">?attr/inst_surface</item>
<item name="colorSurface">?attr/inst_surface</item>
<item name="colorPrimary">?attr/inst_surface</item>
<item name="colorPrimaryVariant">?attr/inst_surface</item>
<item name="colorPrimaryDark">?attr/inst_surface</item>
<item name="android:statusBarColor">?attr/inst_surface</item>
<item name="colorOnSurface">?attr/inst_text_strong</item>
<item name="colorSecondary">?attr/inst_control_active_foreground</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowFullscreen">true</item>
I also tried this:
window.clearFlags(FLAG_TRANSLUCENT_STATUS);
window.addFlags(FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
window.statusBarColor = ContextCompat.getColor(activity(), cs_white);

