Merge "Fixing workspace scrolling, Bug: 4070816" into honeycomb-mr1

This commit is contained in:
Adam Cohen
2011-03-10 13:43:33 -08:00
committed by Android (Google) Code Review
+4
View File
@@ -738,6 +738,7 @@ public abstract class PagedView extends ViewGroup {
* If we return true, onTouchEvent will be called and we do the actual * If we return true, onTouchEvent will be called and we do the actual
* scrolling there. * scrolling there.
*/ */
acquireVelocityTrackerAndAddMovement(ev);
// Skip touch handling if there are no pages to swipe // Skip touch handling if there are no pages to swipe
if (getChildCount() <= 0) return super.onInterceptTouchEvent(ev); if (getChildCount() <= 0) return super.onInterceptTouchEvent(ev);
@@ -816,10 +817,12 @@ public abstract class PagedView extends ViewGroup {
mTouchState = TOUCH_STATE_REST; mTouchState = TOUCH_STATE_REST;
mAllowLongPress = false; mAllowLongPress = false;
mActivePointerId = INVALID_POINTER; mActivePointerId = INVALID_POINTER;
releaseVelocityTracker();
break; break;
case MotionEvent.ACTION_POINTER_UP: case MotionEvent.ACTION_POINTER_UP:
onSecondaryPointerUp(ev); onSecondaryPointerUp(ev);
releaseVelocityTracker();
break; break;
} }
@@ -871,6 +874,7 @@ public abstract class PagedView extends ViewGroup {
if (mUsePagingTouchSlop ? xPaged : xMoved) { if (mUsePagingTouchSlop ? xPaged : xMoved) {
// Scroll if the user moved far enough along the X axis // Scroll if the user moved far enough along the X axis
mTouchState = TOUCH_STATE_SCROLLING; mTouchState = TOUCH_STATE_SCROLLING;
mTotalMotionX += Math.abs(mLastMotionX - x);
mLastMotionX = x; mLastMotionX = x;
mLastMotionXRemainder = 0; mLastMotionXRemainder = 0;
mTouchX = mScrollX; mTouchX = mScrollX;