简体   繁体   English

如何在任何类型的视图上检测 android 中的左右双击

[英]How detect double tap left and right in android on any type of view

last two days i search this query but i cannot find any solution.最近两天我搜索了这个查询,但我找不到任何解决方案。 I ant to detect the double tap left and right on exoplayer video.我 ant 检测 exoplayer 视频上的左右双击。 I used gesturedetector to check double tap but i cannot find a way to detect left and right double tap.我使用手势检测器检查双击,但我找不到检测左右双击的方法。

1) You could get coords of tap from MotionEvent object, calculate center of target view (via x,y, height, width) and then handle this data; 1)您可以从 MotionEvent object 中获取点击坐标,计算目标视图的中心(通过 x、y、高度、宽度)然后处理此数据;

2) You could use two transparent overlays and set listeners to them ) 2)您可以使用两个透明叠加层并为它们设置侦听器)

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

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