summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichael Jurka <mikejurka@google.com>2011-06-07 20:09:16 -0700
committerMichael Jurka <mikejurka@google.com>2011-06-08 14:42:48 -0700
commit20b7ca91b277e9668b6d4b4b3c9116b6778d22a5 (patch)
treea7e8d382edce59d406945e97cda0d204c9dcc9f0 /src
parentf8e0c76e0326440e6371e8eaf88c446e565ee732 (diff)
downloadandroid_packages_apps_Trebuchet-20b7ca91b277e9668b6d4b4b3c9116b6778d22a5.tar.gz
android_packages_apps_Trebuchet-20b7ca91b277e9668b6d4b4b3c9116b6778d22a5.tar.bz2
android_packages_apps_Trebuchet-20b7ca91b277e9668b6d4b4b3c9116b6778d22a5.zip
Fix bug with snapping during scrolling
Bug # 4490518 Change-Id: I1bf1954bc319d18aef45eebfd48b46f4ff0a9038
Diffstat (limited to 'src')
-rw-r--r--src/com/android/launcher2/PagedView.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/com/android/launcher2/PagedView.java b/src/com/android/launcher2/PagedView.java
index 01b3d8e91..13e86b962 100644
--- a/src/com/android/launcher2/PagedView.java
+++ b/src/com/android/launcher2/PagedView.java
@@ -1270,7 +1270,7 @@ public abstract class PagedView extends ViewGroup {
// snap duration. This is a function of the actual distance that needs to be traveled;
// we keep this value close to half screen size in order to reduce the variance in snap
// duration as a function of the distance the page needs to travel.
- float distanceRatio = 1.0f * Math.abs(delta) / 2 * halfScreenSize;
+ float distanceRatio = Math.min(1f, 1.0f * Math.abs(delta) / (2 * halfScreenSize));
float distance = halfScreenSize + halfScreenSize *
distanceInfluenceForSnapDuration(distanceRatio);
@@ -1279,8 +1279,8 @@ public abstract class PagedView extends ViewGroup {
// we want the page's snap velocity to approximately match the velocity at which the
// user flings, so we scale the duration by a value near to the derivative of the scroll
- // interpolator at zero, ie. 5. We use 6 to make it a little slower.
- duration = 6 * Math.round(1000 * Math.abs(distance / velocity));
+ // interpolator at zero, ie. 5. We use 4 to make it a little slower.
+ duration = 4 * Math.round(1000 * Math.abs(distance / velocity));
snapToPage(whichPage, delta, duration);
}