简体   繁体   English

如何检测真人卡中的手势

[英]how to detect gestures in a livecard

I'm writing a glass app, using High Frequency Rendering live cards. 我正在使用High Frequency Rendering live cards写一个玻璃应用程序。

I launch the live card from a service and I draw directly using the DirectRenderingCallback This LiveCard have associated one activity related with the menu. 我从服务中启动了实时卡,我使用DirectRenderingCallback直接绘制。此LiveCard关联了一个与菜单相关的活动。

All work's fine, but i have problems detecting gestures. 一切工作都很好,但我在检测手势方面遇到了问题。 The GestureDetector can be fired from a View or from an activity, but I don't have any .main activity and I don't have any view because I'm drawing directly. 可以从View或活动中触发GestureDetector,但我没有任何.main活动,因为我直接绘制,所以没有任何视图。

Any suggestion about how can I detect the gestures having the LiveCard on top? 有关如何检测具有LiveCard的手势的任何建议?

I do believe they did this on purpose. 我相信他们是故意这样做的。 Since the Live Card is within the timeline, they do not wish for the card to be able to receive the gestures. 由于Live Card在时间线内,因此他们不希望该卡能够接收手势。 If you were able to, you could cause the timeline to behave in rather strange ways. 如果你能够,你可以使时间表以相当奇怪的方式表现。

If you wish to detect gestures, start an activity in the beginning or have an item in your live card's menu that starts the activity. 如果您希望检测手势,请在开头开始活动,或者在实时卡的菜单中有一个开始活动的项目。

Finally I found one way to solve my problem, I can't find the way to fire a gesture from a livecard but i solved my problem launching an Immersion activity. 最后我找到了一种方法来解决我的问题,我找不到从生活卡中触发手势的方法,但我解决了我启动Immersion活动的问题。 Like Jessie suggestion 像杰西的建议

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM