VelocityTracker简单介绍
參照自: http://blog.jrj.com.cn/4586793646,5298605a.html
android.view.VelocityTracker主要用跟踪触摸屏事件(flinging事件和其它gestures手势事件)的速率。用addMovement(MotionEvent)函数将Motion event增加到VelocityTracker类实例中.你能够使用getXVelocity() 或getXVelocity()获得横向和竖向的速率到速率时,可是使用它们之前请先调用computeCurrentVelocity(int)来初始化速率的单位
。
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| void |
addMovement(MotionEvent event)
Add a user's movement to the tracker.
|
||||||||||
| void |
clear()
Reset the velocity tracker back to its initial state.
|
||||||||||
| void |
computeCurrentVelocity(int units, float maxVelocity)
Compute the current velocity based on the points that have been collected.
的表示是,一毫秒时间单位内运动了多少个像素, unitis值为表示一秒(1000毫秒)时间单位内运动了多少个像素
floatVelocity表示速率的最大值
|
||||||||||
| void |
computeCurrentVelocity(int units)
Equivalent to invoking
computeCurrentVelocity(int, with a maximum velocity of Float.MAX_VALUE. |
||||||||||
| abstract T | getNextPoolable() | ||||||||||
| float |
getXVelocity()
Retrieve the last computed X velocity.
|
||||||||||
| float |
getXVelocity(int id)
Retrieve the last computed X velocity.
|
||||||||||
| float |
getYVelocity(int id)
Retrieve the last computed Y velocity.
|
||||||||||
| float |
getYVelocity()
Retrieve the last computed Y velocity.
|
||||||||||
| abstract boolean | isPooled() | ||||||||||
| static VelocityTracker |
obtain()
Retrieve a new VelocityTracker object to watch the velocity of a motion.
|
||||||||||
| void |
recycle()
Return a VelocityTracker object back to be re-used by others.
|
||||||||||
| abstract void | setNextPoolable(T element) | ||||||||||
| abstract void | setPooled(boolean isPooled) | ||||||||||
()函数来获得当前的速度
VelocityTracker简单介绍的更多相关文章
- [原创]关于mybatis中一级缓存和二级缓存的简单介绍
关于mybatis中一级缓存和二级缓存的简单介绍 mybatis的一级缓存: MyBatis会在表示会话的SqlSession对象中建立一个简单的缓存,将每次查询到的结果结果缓存起来,当下次查询的时候 ...
- 利用Python进行数据分析(7) pandas基础: Series和DataFrame的简单介绍
一.pandas 是什么 pandas 是基于 NumPy 的一个 Python 数据分析包,主要目的是为了数据分析.它提供了大量高级的数据结构和对数据处理的方法. pandas 有两个主要的数据结构 ...
- 利用Python进行数据分析(4) NumPy基础: ndarray简单介绍
一.NumPy 是什么 NumPy 是 Python 科学计算的基础包,它专为进行严格的数字处理而产生.在之前的随笔里已有更加详细的介绍,这里不再赘述. 利用 Python 进行数据分析(一)简单介绍 ...
- yii2的权限管理系统RBAC简单介绍
这里有几个概念 权限: 指用户是否可以执行哪些操作,如:编辑.发布.查看回帖 角色 比如:VIP用户组, 高级会员组,中级会员组,初级会员组 VIP用户组:发帖.回帖.删帖.浏览权限 高级会员组:发帖 ...
- angular1.x的简单介绍(二)
首先还是要强调一下DI,DI(Denpendency Injection)伸手获得,主要解决模块间的耦合关系.那么模块是又什么组成的呢?在我看来,模块的最小单位是类,多个类的组合就是模块.关于在根模块 ...
- Linux的简单介绍和常用命令的介绍
Linux的简单介绍和常用命令的介绍 本说明以Ubuntu系统为例 Ubuntu系统的安装自行百度,或者参考http://www.cnblogs.com/CoderJYF/p/6091068.html ...
- iOS-iOS开发简单介绍
概览 终于到了真正接触IOS应用程序的时刻了,之前我们花了很多时间去讨论C语言.ObjC等知识,对于很多朋友而言开发IOS第一天就想直接看到成果,看到可以运行的IOS程序.但是这里我想强调一下,前面的 ...
- iOS开发多线程篇—多线程简单介绍
iOS开发多线程篇—多线程简单介绍 一.进程和线程 1.什么是进程 进程是指在系统中正在运行的一个应用程序 每个进程之间是独立的,每个进程均运行在其专用且受保护的内存空间内 比如同时打开QQ.Xcod ...
- iOS开发UI篇—UITabBarController简单介绍
iOS开发UI篇—UITabBarController简单介绍 一.简单介绍 UITabBarController和UINavigationController类似,UITabBarControlle ...
随机推荐
- 用js给html设置style
[html] view plaincopyprint? 原贴地址:<a href="http://heichong.iteye.com/blog/860698">htt ...
- 安装php时,make步骤报错make: *** [ext/gd/gd.lo] Error 1
安装PHP时,make步骤报错make: *** [ext/gd/gd.lo] Error 1 /usr/local/src/LAMP+memcahed+catci/php-5.4.0/ext/gd/ ...
- JS字符串常用方法
// 来自 http://www.runoob.com/js/js-strings.html var str01 = "odd open xboxone" , str02 ...
- w3wp异常
相信做ASP.NET中大型Web应用的人都碰到过OutOfMemoryException这个异常,对于这个问题我研究了很久,在微软的技术文档上也了解过此问题出现的原因,说实话,到目前我仍然没有完美的解 ...
- jQuery解析JSON的问题
在WEB数据传输过程中,json是以文本,即字符串的轻量级形式传递的,而客户端一般用JS操作的是接收到的JSON对象,所以,JSON对象和JSON字符串之间的相互转换.JSON数据的解析是关键. JS ...
- phalcon的一些中文手册和帮助文档地址收集
1:中文官方网站:http://phalconphp.com/zh/ 挺好可以好好看文档 可安装http://bullsoft.org/phalcon-docs/这个去查找,这是个部分中文的手册! P ...
- 关于 wait_event_interruptible() 和 wake_up()的使用
来源:http://blog.csdn.net/allen6268198/article/details/8112551 1. 关于 wait_event_interruptible() 和 wake ...
- iOS开发——OC篇&常用关键字的使用与区别
copy,assign,strong,retain,weak,readonly,readwrite,nonatomic,atomic,unsafe_unretained的使用与区别 最近在学习iOS的 ...
- 切换samba用户
打开cmd 输入命令 net use \\192.168.xxx.xxx\IPC$ /DELETE 192.168.xxxx.xxx是linux的ip地址
- Currency Exchange
主要找正环: #include<cstdio> #include<cstring> #include<cstdlib> #include<algorithm& ...