Advertisement

System UI Visibility Callback On Android

Started by August 09, 2024 03:14 PM
2 comments, last by Vladimir128 4 months, 1 week ago

Hi everyone. I'm making a game engine and while working on Android I've noticed a weird issue with the system UI which is not present on iOS. When I swype near the edge of the screen in fullscreen mode, a transparent menu appears on the right and top side of the screen, which is intended. What is not intended though, is that the game reacts on finger moving like there is no menu at all. And what's even more interesting, I've noticed the same behaviour in almost all the games I tried. Which may be quite annoying, for example when there are dialogs in a game and they are skipped unintendedly by calling the menu. I don't find it a good idea to deal with the coordinates to prevent the input handling, it seems better to deal with some callback which is called when the menu appears. But I can't find such kind of callback, for example OnSystemUiVisibilityChangeListener didn't react on the transparent menu. Has anyone some ideas about it? Even if not, let's just try to solve it together guys, because it looks like an Android bug which should have some standard workaround. I've also tried setWindowInsetsAnimationCallback, and it is called sometimes, but not when the UI appears

The interface was deprecated 5 versions ago, back in 2020.

IIRC, visibility change notice was for the global system bar changing visibility. Overlays are handled differently. Window insets are handled differently.

As for getting the touch events that's going to depend on how you are getting them. They can be system-wide, they can be filtered by the view. If you have requested the unfiltered details then you'll see the information regardless of overlays or window insets.

Advertisement

@frob I handle input just by overriding “boolean onTouchEvent(MotionEvent event)”

This topic is closed to new replies.

Advertisement