忽略沉浸模式轻扫 [英] Ignore Immersive mode swipe

查看:366
本文介绍了忽略沉浸模式轻扫的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

随着Android 4.4系统的全屏沉浸模式下运行游戏,从屏幕的边缘用户扫描显示通知/状态栏和放大器;菜单按钮栏

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?

推荐答案

在K,有没有办法做到这一点。该系统接收移动事件的并行应用程序,而不是之前。这避免引起延迟,并给出应用程序/游戏来实现使用这些手势事件的能力。

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.

请记住,即使一个手势开始在边缘附近,它可能不会结束的姿态结束的时间满足边缘轻扫的要求。你可能想看看<一href="https://android.googlesource.com/platform/frameworks/base/+/android-4.4.2_r1/policy/src/com/android/internal/policy/impl/SystemGesturesPointerEventListener.java"相对=nofollow>手势定义在AOSP如果你想避免它。

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.

这篇关于忽略沉浸模式轻扫的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆