GestureDetector类的用法
来源:互联网 发布:方小顿出来了吗 知乎 编辑:程序博客网 时间:2024/05/19 18:42
GestureDetector类定义了许多触摸事件。包括
1.boolean onDoubleTap(MotionEvent e)解释:双击的第二下Touch down时触发
2.boolean onDoubleTapEvent(MotionEvent e)解释:双击的第二下Touch down和up都会触发,可用e.getAction()区分。
3.boolean onDown(MotionEvent e)解释:Touch down时触发
4.boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY)解释:Touch了滑动一点距离后,up时触发。
5.void onLongPress(MotionEvent e)解释:Touch了不移动一直Touch down时触发
6.boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY)解释:Touch了滑动时触发。
7.void onShowPress(MotionEvent e)解释:Touch了还没有滑动时触发(与onDown,onLongPress)比较onDown只要Touch down一定立刻触发。而Touchdown后过一会没有滑动先触发onShowPress再是onLongPress。所以Touchdown后一直不 滑动,onDown->onShowPress->onLongPress这个顺序触发。
8.boolean onSingleTapConfirmed(MotionEvent e)
9.boolean onSingleTapUp(MotionEvent e)解释:上面这两个函数都是在touch down后又没有滑动(onScroll),又没有长按(onLongPress),然后Touchup时触发。
点击一下非常快的(不滑动)Touchup:onDown->onSingleTapUp->onSingleTapConfirmed
点击一下稍微慢点的(不滑 动)Touchup:onDown->onShowPress->onSingleTapUp->onSingleTapConfirmed
1.boolean on
2.boolean on
3.boolean on
4.boolean on
5.void on
6.boolean on
7.void on
8.boolean on
9.boolean on
点击一下非常快的(不滑动)Touchup:on
点击一下稍微慢点的(不滑 动)Touchup:on
- GestureDetector类的用法
- GestureDetector类的用法
- GestureDetector类的用法
- GestureDetector类的用法
- GestureDetector类的用法
- GestureDetector类的用法
- GestureDetector类的用法
- GestureDetector类的用法
- GestureDetector类的用法
- GestureDetector类的用法
- gestureDetector类的用法
- GestureDetector类的用法
- GestureDetector类及其用法
- GestureDetector类及其用法
- GestureDetector类及其用法
- GestureDetector类及其用法
- GestureDetector类及其用法
- GestureDetector类及其用法
- 高性能服务器的资源和相关站点
- app中自定义url
- Redis 使用的一些经验分享
- CWebBrowser之put_value报错
- 整理些草笔记
- GestureDetector类的用法
- Office PIA:关于Office PIA应用程序的部署
- 【Ubuntu】从硬盘安装ubuntu
- 动态链接库与静态链接库
- 实习阶段性小结(2.7-3.14)
- 人工智能机器人(aiml语言)
- Redis 使用的一些经验分享
- Struts工程web.xml配置
- 3Dmax导出动画文件