How to hide Android systembars & navigationbars without blocking floating widgets from being closable?

21 Views Asked by At

I have a NativeActivity (game) and use the following code to hide the system bars in Kotlin.

WindowInsetsControllerCompat(window, window.decorView).hide(WindowInsetsCompat.Type.systemBars())

My game has its own button bar across the bottom of the screen and I don't receive touches if I don't hide the navigation bar.

But when I hide the navigation bar then floating widgets like Facebook Messenger heads, etc. can't be dragged to the (X) at the bottom of the screen to be dismissed. Dragging stops where the top of the navigation bar would be but the (X) is at the actual bottom of the screen. The widgets can't be closed because they can't be dragged all the way to the (X) because something outside of my code thinks the navigation bar is still there.

Is there some way around this problem, such as another way to hide the navigation bar?

0

There are 0 best solutions below