Fix small scrolling regression

-> only cancel scrolling when necessary to avoid
   unnecessary snapToDestination() calls

Change-Id: I406bef2453c88d61d25f66be67205ab8fbd69ec9
This commit is contained in:
Adam Cohen
2013-11-08 06:28:17 -08:00
parent a164844990
commit 2da0a05327

View File

@@ -1368,10 +1368,13 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
*/
final int xDist = Math.abs(mScroller.getFinalX() - mScroller.getCurrX());
final boolean finishedScrolling = (mScroller.isFinished() || xDist < mTouchSlop);
if (finishedScrolling) {
mTouchState = TOUCH_STATE_REST;
mScrollAbortedFromIntercept = true;
abortScrollerAnimation(false);
if (!mScroller.isFinished()) {
mScrollAbortedFromIntercept = true;
abortScrollerAnimation(false);
}
} else {
if (isTouchPointInViewportWithBuffer((int) mDownMotionX, (int) mDownMotionY)) {
mTouchState = TOUCH_STATE_SCROLLING;