diff options
author | Dave Burke <daveburke@google.com> | 2012-10-25 17:19:09 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-10-25 17:19:09 -0700 |
commit | e57e793bbdc6c51ba13481f82ff17a2f3e6910c5 (patch) | |
tree | 595b6849ef55c282ed8fcda1844c23315b37ad9f /src/com/android/launcher2 | |
parent | 8634f8494a0260b75a82f82e8d4a7985030d04c8 (diff) | |
parent | 97687ef66b209d39d6bc20aeb1496774b66fddd1 (diff) | |
download | android_packages_apps_Trebuchet-e57e793bbdc6c51ba13481f82ff17a2f3e6910c5.tar.gz android_packages_apps_Trebuchet-e57e793bbdc6c51ba13481f82ff17a2f3e6910c5.tar.bz2 android_packages_apps_Trebuchet-e57e793bbdc6c51ba13481f82ff17a2f3e6910c5.zip |
Merge "Cap launcher swipe animations to max duration" into jb-mr1-dev
Diffstat (limited to 'src/com/android/launcher2')
-rw-r--r-- | src/com/android/launcher2/PagedView.java | 2 |
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); } |