hardysimon Stack Overflow • Recommends
I'm trying to get edge-to-edge (link to this video) working correctly on API 21 up to 29.
I'm using this on my v27\themes.xml :
<item name="android:windowLightNavigationBar">true</item>
<item name="android:navigationBarColor">@android:color/transparent</item>
And this in my Activity:
override fun onWindowFocusChanged(hasFocus: Boolean) {
super.onWindowFocusChanged(hasFocus)
if (hasFocus) {
window.decorView.systemUiVisibility =
View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION or View.SYSTEM_UI_FLAG_LAYOUT_STABLE
}
}
Plus, I'm setting android:fitsSystemWindows=true on my AppBarLayout .
With that in place, it looks fine on API >= 27 where the content scrolls behind the now transparent navigati…