Ignore Immersive mode swipe
Asked Answered
P

2

14

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?

Polymer answered 11/12, 2013 at 21:32 Comment(0)
H
3

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.

Hakluyt answered 17/12, 2013 at 16:2 Comment(1)
Thanks for the feedback & the suggestion. Will update here if I come up with somethingPolymer
W
2

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.

Windom answered 20/12, 2013 at 2:31 Comment(1)
Interesting suggestion, let me try it outPolymer

© 2022 - 2024 — McMap. All rights reserved.