VelocityTracker类
用来跟踪触摸速度的类
当你需要跟踪的时候使用obtain()方法来来获得VelocityTracker类的一个实例对象
使用addMovement(MotionEvent)函数将当前的移动事件传递给VelocityTracker对象
使用computeCurrentVelocity (int units)函数来计算当前的速度
使用getXVelocity ()、getYVelocity ()函数来获得当前的速度
VelocityTracker类用于跟踪触摸速度。通过obtain()方法获取实例,使用addMovement(MotionEvent)函数传递移动事件,computeCurrentVelocity(int units)计算速度,获取当前速度使用getXVelocity()和getYVelocity()。
用来跟踪触摸速度的类
当你需要跟踪的时候使用obtain()方法来来获得VelocityTracker类的一个实例对象
使用addMovement(MotionEvent)函数将当前的移动事件传递给VelocityTracker对象
使用computeCurrentVelocity (int units)函数来计算当前的速度
使用getXVelocity ()、getYVelocity ()函数来获得当前的速度