Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ignore Immersive mode swipe

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?

like image 656
codemonkey Avatar asked Dec 11 '13 21:12

codemonkey


People also ask

How do I turn off immersive mode on Android?

Non-sticky (normal) immersive mode — A user can exit immersive mode, by swiping in the system bars. Sticky immersive mode — A user can temporarily exit immersive mode by swiping in the system bars. Immersive mode is automatically re-entered after a short time (few seconds).

What is immersive mode in Android?

Some content is best experienced fullscreen without any indicators on the status bar or the navigation bar. Some examples are videos, games, image galleries, books, and slides in a presentation. This is referred to as immersive mode.


1 Answers

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.

like image 69
jspurlock Avatar answered Sep 22 '22 01:09

jspurlock