笔记

ViewCompat.canScrollVertically(view, -1)//是否能向下滚动
ViewCompat.canScrollVertically(view, 1)//是否能向上滚动

private VelocityTracker mVelocityTracker;//速率

mVelocityTracker = VelocityTracker.obtain();//初始化

mVelocityTracker.addMovement(ev);//事件添加进去

mVelocityTracker.computeCurrentVelocity(1000);
float yVelocity = mVelocityTracker.getYVelocity();//获取Y轴上的瞬时速度

mVelocityTracker.clear();
mVelocityTracker.recycle();

你可能感兴趣的:(笔记)