summaryrefslogtreecommitdiffstats
path: root/src/com/android
diff options
context:
space:
mode:
authorAdam Cohen <adamcohen@google.com>2011-03-10 11:33:35 -0800
committerAdam Cohen <adamcohen@google.com>2011-03-10 11:33:35 -0800
commit6342bbae1a18f3c1862953e33309481703f541cf (patch)
treee5ee6da1076b3963d4d759f7696328a70fda7197 /src/com/android
parente4b7729b9d6343b4e7e0905e117e5ac469727cbe (diff)
downloadandroid_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
Diffstat (limited to 'src/com/android')
-rw-r--r--src/com/android/launcher2/PagedView.java4
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;