I'm using a single activity - multiple fragment architecture with a bottom navigation bar. There are some fragments that use a stable layout flag, and others that use a fullscreen layout flag. However, when switching from SYSTEM_UI_FLAG_LAYOUT_STABLE to SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN (and vice versa), the content doesn't fill the screen properly - when switching to stable, the bottom is pushed down past the navigation, and when switched back to fullscreen, the content doesn't fill the screen properly. If I switch to another fullscreen fragment from that one, the issue corrects itself. I wanted to know if there was a way to keep that issue from happening in the first place.
This is the code I'm using to switch between stable and fullscreen:
fun makeFullScreen() {
window.decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_LAYOUT_STABLE or View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
}
fun makeStable() {
window.decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_LAYOUT_STABLE
}
The respective functions are being called in the onResume() function of each fragment. Any help would be greatly appreciated.
You can see screenshots of the issue here: https://i.stack.imgur.com/xI6n8.jpg
Thanks
Edit 1: Just to clarify, I basically want it so that the bottom navigation bar stays in the right place at the bottom, rather than the "jumping" behavior you see in the screenshots.