summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichael Jurka <mikejurka@google.com>2011-06-09 13:32:21 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2011-06-09 13:32:21 -0700
commitfbd14ac287f22ff05c7538a3122484272861f620 (patch)
tree54837ccde537f0878843295e7adfee349dfb17c3 /src
parent3732cf8b49a5c386c91030df5b2a9811e6480acf (diff)
parent83c70cf8ee6ff5912394ce9b3efc0bdea9401ae2 (diff)
downloadandroid_packages_apps_Trebuchet-fbd14ac287f22ff05c7538a3122484272861f620.tar.gz
android_packages_apps_Trebuchet-fbd14ac287f22ff05c7538a3122484272861f620.tar.bz2
android_packages_apps_Trebuchet-fbd14ac287f22ff05c7538a3122484272861f620.zip
am 83c70cf8: am d9455775: am 20b7ca91: Fix bug with snapping during scrolling
* commit '83c70cf8ee6ff5912394ce9b3efc0bdea9401ae2': Fix bug with snapping during scrolling
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 79f0d562b..605f4b69f 100644
--- a/src/com/android/launcher2/PagedView.java
+++ b/src/com/android/launcher2/PagedView.java
@@ -1306,7 +1306,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);
@@ -1315,8 +1315,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);
}