diff options
author | Adam Cohen <adamcohen@google.com> | 2011-03-10 11:33:35 -0800 |
---|---|---|
committer | Adam Cohen <adamcohen@google.com> | 2011-03-10 11:33:35 -0800 |
commit | 6342bbae1a18f3c1862953e33309481703f541cf (patch) | |
tree | e5ee6da1076b3963d4d759f7696328a70fda7197 | |
parent | e4b7729b9d6343b4e7e0905e117e5ac469727cbe (diff) | |
download | android_packages_apps_Trebuchet-6342bbae1a18f3c1862953e33309481703f541cf.tar.gz android_packages_apps_Trebuchet-6342bbae1a18f3c1862953e33309481703f541cf.tar.bz2 android_packages_apps_Trebuchet-6342bbae1a18f3c1862953e33309481703f541cf.zip |
Fixing workspace scrolling, Bug: 4070816
Change-Id: I8ff7d59f8d64e3deee022161f942dfe35359bdd2
-rw-r--r-- | src/com/android/launcher2/PagedView.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/com/android/launcher2/PagedView.java b/src/com/android/launcher2/PagedView.java index 26ea4a812..e7ecb9914 100644 --- a/src/com/android/launcher2/PagedView.java +++ b/src/com/android/launcher2/PagedView.java @@ -738,6 +738,7 @@ public abstract class PagedView extends ViewGroup { * If we return true, onTouchEvent will be called and we do the actual * scrolling there. */ + acquireVelocityTrackerAndAddMovement(ev); // Skip touch handling if there are no pages to swipe if (getChildCount() <= 0) return super.onInterceptTouchEvent(ev); @@ -816,10 +817,12 @@ public abstract class PagedView extends ViewGroup { mTouchState = TOUCH_STATE_REST; mAllowLongPress = false; mActivePointerId = INVALID_POINTER; + releaseVelocityTracker(); break; case MotionEvent.ACTION_POINTER_UP: onSecondaryPointerUp(ev); + releaseVelocityTracker(); break; } @@ -871,6 +874,7 @@ public abstract class PagedView extends ViewGroup { if (mUsePagingTouchSlop ? xPaged : xMoved) { // Scroll if the user moved far enough along the X axis mTouchState = TOUCH_STATE_SCROLLING; + mTotalMotionX += Math.abs(mLastMotionX - x); mLastMotionX = x; mLastMotionXRemainder = 0; mTouchX = mScrollX; |