bVNC多点触控分析
来源:互联网 发布:mp3播放软件 安卓 编辑:程序博客网 时间:2024/05/17 05:17
- IBCScaleGestureDetector 多点触控手势接口
- DummyScaleGestureDetector 不支持多点触控
- ScaleGestureDetector 支持多点触控
- //触屏模式
- //先检测缩放模式,再检测滑动模式
- simulatedTouchpadInputHandler(AbstractGestureInputHandler).onScale(IBCScaleGestureDetector)
- line: 470 {
- boolean consumed = true;
- // Get the current focus.
- xCurrentFocus = detector.getFocusX();
- yCurrentFocus = detector.getFocusY();
-
- // If we haven't started scaling yet, we check whether a swipe is being performed.
- // The arbitrary fudge factor may not be the best way to set a tolerance...
- if (!inScaling) { //缩放模式
-
- // Start swiping mode only after we've moved away from the initial focal point some distance.
- if (!inSwiping) {//滑动模式,移动距离超过40个像素
- if ( (yCurrentFocus < (yInitialFocus - baseSwipeDist)) ||
- (yCurrentFocus > (yInitialFocus + baseSwipeDist)) ||
- (xCurrentFocus < (xInitialFocus - baseSwipeDist)) ||
- (xCurrentFocus > (xInitialFocus + baseSwipeDist)) ) {
- inSwiping = true;
- xPreviousFocus = xInitialFocus;
- yPreviousFocus = yInitialFocus;
- }
- }
-
- // If in swiping mode, indicate a swipe at regular intervals.
- if (inSwiping) {
- twoFingerSwipeUp = false;
- twoFingerSwipeDown = false;
- twoFingerSwipeLeft = false;
- twoFingerSwipeRight = false;
- if (yCurrentFocus < (yPreviousFocus - baseSwipeDist)) {
- twoFingerSwipeDown = true;//向下滑动
- xPreviousFocus = xCurrentFocus;
- yPreviousFocus = yCurrentFocus;
- } else if (yCurrentFocus > (yPreviousFocus + baseSwipeDist)) {
- twoFingerSwipeUp = true;//向上滑动
- xPreviousFocus = xCurrentFocus;
- yPreviousFocus = yCurrentFocus;
- } else if (xCurrentFocus < (xPreviousFocus - baseSwipeDist)) {
- twoFingerSwipeRight = true;//向右滑动
- xPreviousFocus = xCurrentFocus;
- yPreviousFocus = yCurrentFocus;
- } else if (xCurrentFocus > (xPreviousFocus + baseSwipeDist)) {
- twoFingerSwipeLeft = true;//向左滑动
- xPreviousFocus = xCurrentFocus;
- yPreviousFocus = yCurrentFocus;
- } else {
- consumed = false;
- }
- // The faster we swipe, the faster we traverse the screen, and hence, the
- // smaller the time-delta between consumed events. We take the reciprocal
- // obtain swipeSpeed. If it goes to zero, we set it to at least one.
- long elapsedTime = detector.getTimeDelta();
- if (elapsedTime < 10) elapsedTime = 10;
-
- swipeSpeed = baseSwipeTime/elapsedTime;
- if (swipeSpeed == 0) swipeSpeed = 1;
- if (consumed) Log.d(TAG,"Current swipe speed: " + swipeSpeed);
- }
- }
-
- if (!inSwiping) {
-
- if ( !inScaling && Math.abs(1.0 - detector.getScaleFactor()) < minScaleFactor ) {
- Log.i(TAG,"Not scaling due to small scale factor.");
- consumed = false;
- }
- if (consumed) {
- inScaling = true;
- Log.i(TAG,"Adjust scaling " + detector.getScaleFactor());
- if (canvas != null && canvas.scaling != null)
- canvas.scaling.adjust(activity, detector.getScaleFactor(), xCurrentFocus, yCurrentFocus);
- }
- }
- return consumed;
- }
- //SimulatedTouchpadInputHandler.onScale(IBCScaleGestureDetector) line: 1
- //ScaleGestureDetector.onTouchEvent(MotionEvent) line: 258
- SimulatedTouchpadInputHandler(AbstractGestureInputHandler).onTouchEvent(MotionEvent)
- line: 460 {
- //多点触控手势
- scaleGestures.onTouchEvent(e);
-
- }
- //SimulatedTouchpadInputHandler.onTouchEvent(MotionEvent) line: 1
- RemoteCanvasActivity.onTouchEvent(MotionEvent) line: 1217 {
- try {
- //activity检测到TouchEvent
- return inputHandler.onTouchEvent(event);
- } catch (NullPointerException e) { }
- return false;
- }
0
上一篇:dpkg 查询一个软件包的安装文件
下一篇:bVNC单点触控分析
相关热门文章
- Android之开发环境搭建
- Android自定义View的实现...
- AndroidManifest.xml配置文件...
- Android相对布局+圆角按钮+Sha...
- 查看Android应用包名package和...
- linux dhcp peizhi roc
- 关于Unix文件的软链接
- 求教这个命令什么意思,我是新...
- sed -e "/grep/d" 是什么意思...
- 谁能够帮我解决LINUX 2.6 10...
给主人留下些什么吧!~~
评论热议
0 0
- bVNC多点触控分析
- bVNC单点触控分析
- bvnc
- bVNC 客户端源码分析(android)
- 多点触控
- android多点触控
- Android多点触控
- 多点触控
- 触摸屏多点触控
- android 多点触控
- android 多点触控
- 多点触控参数
- 多点触控
- 多点触控
- android 多点触控
- android 多点触控
- 多点触控 - MFC
- Android多点触控
- bVNC 客户端源码分析(android)
- 【ExpandableListView】ExpandableListView互斥展开效果
- android项目增加v7.appcompat
- dpkg 查询一个软件包的安装文件
- JAVA基础再回首(二十五)——Lock锁的使用、死锁问题、多线程生产者和消费者、线程池、匿名内部类使用多线程、定时器、面试题
- bVNC多点触控分析
- bVNC单点触控分析
- 私网地址(PrivateAddress)
- linux rdp 共享剪贴板
- 显示最近30秒内所上传的信息
- android开发中关于写入IMEI号问题总结
- OpenGL ES 三种类型修饰 uniform attribute varying
- ubuntu 计算器xcalc
- #include sys/xxx.h头文件 UNIX头文件
原创粉丝点击
热门IT博客
热门问题
老师的惩罚
人脸识别
我在镇武司摸鱼那些年
重生之率土为王
我在大康的咸鱼生活
盘龙之生命进化
天生仙种
凡人之先天五行
春回大明朝
姑娘不必设防,我是瞎子
东风是什么意思
东风汽车货车全部车型
东风货车全部车型
东风小货车新车价格及图片
东风车型大全
东风suv越野车
东风面包车大全
东风系列轿车
东风微型货车报价及图片
东风面包车价格图片
东风卡车报价
东风重卡报价及图片
东风卡车价格
东风天龙牵引车报价
东风卡车4s店
东风日产启辰d50价格
东风猛士民用版报价
东风卡车报价及图片
东风标致汽车价格
东风轻卡货车
东风风神越野车ax7
东风悦达起亚k4价格
东风153随车吊价格
东风日产骊威2014款
东风多利卡报价
东风乘龙汽车报价
东风悦达起亚k3售价
东风日产轩逸配件
东风日产骐达三厢
东风风光怎么样
东风雪铁龙价位
东风标致新车
东风轻卡自卸车
东风天龙商务车
东风商用车4s店
东风标致四s店
东风日产启辰r50x
东风自卸车价格
东风日产启辰r50价格
尼桑商务车7座图片报价
风神suv