Allowing ability to pick up items / enter overview before full page settle

-> Fixes issue 11701996
-> Fixes issue where if you tried to longpress a widget before the page
   settled, it would instead enter overview

Change-Id: Ic6321805687dd5e8c69506c6cd6941a11d557ed6
This commit is contained in:
Adam Cohen committed 2013-11-18 20:08:11 +00:00
1 parent f9618856d6
commit a765215280
2 files changed
+3 -9

No files matched your search

+3 -8
View File
@@ -153,7 +153,6 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
protected int mTouchState = TOUCH_STATE_REST;
protected boolean mForceScreenScrolled = false;
private boolean mScrollAbortedFromIntercept = false;
protected OnLongClickListener mLongClickListener;
@@ -1392,13 +1391,13 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
* being flinged.
*/
final int xDist = Math.abs(mScroller.getFinalX() - mScroller.getCurrX());
final boolean finishedScrolling = (mScroller.isFinished() || xDist < mTouchSlop);
final boolean finishedScrolling = (mScroller.isFinished() || xDist < mTouchSlop / 3);
if (finishedScrolling) {
mTouchState = TOUCH_STATE_REST;
if (!mScroller.isFinished()) {
mScrollAbortedFromIntercept = true;
abortScrollerAnimation(false);
setCurrentPage(getNextPage());
pageEndMoving();
}
} else {
if (isTouchPointInViewportWithBuffer((int) mDownMotionX, (int) mDownMotionY)) {
@@ -1426,9 +1425,6 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
case MotionEvent.ACTION_UP:
case MotionEvent.ACTION_CANCEL:
if (mScrollAbortedFromIntercept) {
snapToDestination();
}
resetTouchState();
break;
@@ -1997,7 +1993,6 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
releaseVelocityTracker();
endReordering();
mCancelTap = false;
mScrollAbortedFromIntercept = false;
mTouchState = TOUCH_STATE_REST;
mActivePointerId = INVALID_POINTER;
}