From a206daaed1318005d1534cca2e4eeec56144d104 Mon Sep 17 00:00:00 2001 From: Romain Guy Date: Mon, 6 Jul 2009 11:51:18 -0700 Subject: [PATCH] Related to #1444844. Caps fling velocity on Home. --- src/com/android/launcher/Workspace.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/com/android/launcher/Workspace.java b/src/com/android/launcher/Workspace.java index d91519c94e..f5dc633414 100644 --- a/src/com/android/launcher/Workspace.java +++ b/src/com/android/launcher/Workspace.java @@ -106,6 +106,7 @@ public class Workspace extends ViewGroup implements DropTarget, DragSource, Drag private boolean mLocked; private int mTouchSlop; + private int mMaximumVelocity; final Rect mDrawerBounds = new Rect(); final Rect mClipBounds = new Rect(); @@ -150,7 +151,9 @@ public class Workspace extends ViewGroup implements DropTarget, DragSource, Drag mPaint = new Paint(); mPaint.setDither(false); - mTouchSlop = ViewConfiguration.get(getContext()).getScaledTouchSlop(); + final ViewConfiguration configuration = ViewConfiguration.get(getContext()); + mTouchSlop = configuration.getScaledTouchSlop(); + mMaximumVelocity = configuration.getScaledMaximumFlingVelocity(); } /** @@ -813,7 +816,7 @@ public class Workspace extends ViewGroup implements DropTarget, DragSource, Drag case MotionEvent.ACTION_UP: if (mTouchState == TOUCH_STATE_SCROLLING) { final VelocityTracker velocityTracker = mVelocityTracker; - velocityTracker.computeCurrentVelocity(1000); + velocityTracker.computeCurrentVelocity(1000, mMaximumVelocity); int velocityX = (int) velocityTracker.getXVelocity(); if (velocityX > SNAP_VELOCITY && mCurrentScreen > 0) {