summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher2/PagedView.java
diff options
context:
space:
mode:
authorChet Haase <chet@google.com>2012-10-25 16:01:11 -0700
committerChet Haase <chet@google.com>2012-10-25 16:01:11 -0700
commit97687ef66b209d39d6bc20aeb1496774b66fddd1 (patch)
tree9ebb5f280f63de88616c79675c2e4bf248d8b678 /src/com/android/launcher2/PagedView.java
parentee4513920446ace2bc2659e3315f5b648ec1e313 (diff)
downloadandroid_packages_apps_Trebuchet-97687ef66b209d39d6bc20aeb1496774b66fddd1.tar.gz
android_packages_apps_Trebuchet-97687ef66b209d39d6bc20aeb1496774b66fddd1.tar.bz2
android_packages_apps_Trebuchet-97687ef66b209d39d6bc20aeb1496774b66fddd1.zip
Cap launcher swipe animations to max duration
large screens take too long swiping between screens. Cap the duration to some max value to make things snappier. Change-Id: Iee967c1b00b4962a0490fd0e20d48d7d8363dd2f
Diffstat (limited to 'src/com/android/launcher2/PagedView.java')
-rw-r--r--src/com/android/launcher2/PagedView.java2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/com/android/launcher2/PagedView.java b/src/com/android/launcher2/PagedView.java
index 9b973847c..2fc788b83 100644
--- a/src/com/android/launcher2/PagedView.java
+++ b/src/com/android/launcher2/PagedView.java
@@ -59,6 +59,7 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
private static final int MIN_LENGTH_FOR_FLING = 25;
protected static final int PAGE_SNAP_ANIMATION_DURATION = 550;
+ protected static final int MAX_PAGE_SNAP_DURATION = 750;
protected static final int SLOW_PAGE_SNAP_ANIMATION_DURATION = 950;
protected static final float NANOTIME_DIV = 1000000000.0f;
@@ -1473,6 +1474,7 @@ public abstract class PagedView extends ViewGroup implements ViewGroup.OnHierarc
// user flings, so we scale the duration by a value near to the derivative of the scroll
// interpolator at zero, ie. 5. We use 4 to make it a little slower.
duration = 4 * Math.round(1000 * Math.abs(distance / velocity));
+ duration = Math.min(duration, MAX_PAGE_SNAP_DURATION);
snapToPage(whichPage, delta, duration);
}