Question

With the game running in Android 4.4's Fullscreen Immersive Mode, the user swipes from the edge of the screen to show the notification / status bar & the Menu buttons bar

However, these swipes are also passed to the game underneath as downward swipes

Is there an official / clean way to ignore those swipes other than hard-coding a specific are of the screen to ignore down swipes from?

Was it helpful?

Solution

In K, there is no way to do this. The system receives motion events in parallel to your application, not before. This avoids introducing latency and gives apps/games the ability to implement gestures using these events.

Bear in mind that even if a gesture starts near the edge, it may not end up meeting the requirements for an edge swipe by the time the gesture ends. You may want to look at the gesture definition in AOSP if you are trying to avoid it.

OTHER TIPS

i want the exact the same thing. i am developing a drawing APP and want to turn on immessive mode. but when swipin, the touch event is passed in, which results a wrong drawing curve. this is not acceptable. it would be great if if the gesture just eat the event instead of dispatch to my app.

i'd suggest fire an CANCEL event to APP once the system gesture is detected and fired.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top