Android的手指检测 - 方向和椭圆 [英] Android finger detection - Orientation and ellipse

查看:748
本文介绍了Android的手指检测 - 方向和椭圆的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在寻找一种方式使用移动触摸设备时,与触摸区域的椭圆,形式简化检测手指的方向。我选择Android的,而不是iOS的,因为我发现了三个有用的方法( getTouchMajor() getTouchMinor(),并 getOrientation())在为 MotionEvent类 Android的参考。 但我一直在努力,实现我的应用程序这三种方法,而且可悲的是,他们不返回的希望值。定向保持为0,不管是什么,而getTouchMajor和getTouchMinor是完全一样的,每次。

I've been looking for a way to detect the finger orientation together with a simplification of the touch area in the form of an ellipse, when using a mobile touch device. I choose Android rather than iOS since I found three usefull methods (getTouchMajor(), getTouchMinor(), and getOrientation()) in the Android reference for the MotionEvent class. But I've tried to implement these three methods in my app, and sadly they does not return the wanted values. The orientation stays at 0, no matter what, while the getTouchMajor and getTouchMinor is exactly the same each time.

所以我的问题是:我做somethign错误的或者是这些方法只是尚未实现

So my question is: Am I doing somethign wrong or is these methods just not implemented yet?

(我试过,包括多个不同设备的功能:5的Nexus,Nexus的7,和HTC一)

(I've tried the functions on several different devices including: Nexus 5, Nexus 7, and HTC One)

推荐答案

当我们一起工作,我知道你知道这个答案,但我只想把它使得#1的各位用户可以拥有它。

As we work together I know you know this answer, but I just wanted to put it up such that fellow users of Stackoverflow can have it as well.

我们发现暗示的意见,也许触摸屏驱动程序大多数设备没有提供这一数据到系统中。

We have found suggestive comments that maybe the touch screen drivers for most devices do not provide this data to the system.

我们最初测试:三星Galaxy S2,HTC的一个方面,Nexus 5次(LG)和Nexus 7(华硕),三星Galaxy轻按3

We originally tested: Samsung Galaxy S2, HTC One, Nexus 5 (by LG) and Nexus 7 (by Asus), Samsung Galaxy Tap 3.

相对于其他三星Galaxy抽头3,给不同的值getTouchMajor()和getTouchMinor(),但这种关系被认为getTouchMajor()= getTouchMinor()* 3,和getOrientation()总是0,如与所有其他设备。

As opposed to the others the Samsung Galaxy Tap 3, gave different values for getTouchMajor() and getTouchMinor(), but this relationship was seen getTouchMajor() = getTouchMinor() * 3, and getOrientation() was always 0, as with all the other devices.

大约2个月后,我们发现,在谷歌Nexus 10 可以显示与方向线的椭圆,当你激活的输入:指针位置的下开发商设置

About 2 months later we discovered that the Google Nexus 10 can show an ellipse with a direction line, when you activate Input: Pointer Location under developer settings.

最初的结论是,大多数设备不支持,getTouchMajor(),getTouchMinor()。或getOrientation(),这可能是电容触摸屏的限制。 但看到的Nexus 10 ,然后椭圆和方向的跟踪让人们对新的交互设计。

The initial conclusion was that most devices do not support, getTouchMajor(), getTouchMinor(). or getOrientation(), Which could be a limitation of the capacitative touch screens. But seeing the Nexus 10, and the tracking of the ellipse and orientation gives hope for new interaction design.

这表明,我认为某些设备兑现getTouchMinor和getTouchMajor以及方向。 (或历史的相同功能的版本)。 我还没有机会对设备code自己的东西,但它似乎也合情合理。

It indicates to me that some devices do deliver on getTouchMinor and getTouchMajor as well as orientation. (or historical versions of the same functions). I have not had the chance to code anything for the device myself but it seems plausible.

这篇关于Android的手指检测 - 方向和椭圆的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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