我想根据 onTouchEvent 检查 MotionEvent.ACTION_UP 来检测用户何时停止使用 android.widget.Scroller 滚动。当用户滚动一次它可以正常工作但是当用户快速滚动以到达特定位置时,它表明用户滚动了很多次,尽管我想将它检测为一个滚动。我怎样才能做到这一点?
@Override
public boolean onTouchEvent(MotionEvent event) {
if(event.getAction() == MotionEvent.ACTION_UP) {
if(mIsScrolling) {
mIsScrolling = false;
//
}
}
mScaleDetector.onTouchEvent(event);
return mGestureDetector.onTouchEvent(event);
}