diff options
author | Jon Miranda <jonmiranda@google.com> | 2017-06-07 17:01:35 -0700 |
---|---|---|
committer | Jon Miranda <jonmiranda@google.com> | 2017-06-26 22:45:53 -0700 |
commit | ad3194ec81a2eb1d5823dd892fc8590c613c991b (patch) | |
tree | dc2078909105196b8a56cf59b588fcd1eb38735f /src/com/android/launcher3/anim | |
parent | d392255539e069f4846514b33e438447cda628a3 (diff) | |
download | android_packages_apps_Trebuchet-ad3194ec81a2eb1d5823dd892fc8590c613c991b.tar.gz android_packages_apps_Trebuchet-ad3194ec81a2eb1d5823dd892fc8590c613c991b.tar.bz2 android_packages_apps_Trebuchet-ad3194ec81a2eb1d5823dd892fc8590c613c991b.zip |
Add overscroll w/ physics to All Apps.
Bug: 62628421
Bug: 38349031
Change-Id: If3ba6dfbbd3a4b1c87e69df0066f801f963752aa
Diffstat (limited to 'src/com/android/launcher3/anim')
-rw-r--r-- | src/com/android/launcher3/anim/SpringAnimationHandler.java | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/com/android/launcher3/anim/SpringAnimationHandler.java b/src/com/android/launcher3/anim/SpringAnimationHandler.java index 038f82682..1efc4e4e1 100644 --- a/src/com/android/launcher3/anim/SpringAnimationHandler.java +++ b/src/com/android/launcher3/anim/SpringAnimationHandler.java @@ -127,6 +127,19 @@ public class SpringAnimationHandler<T> { reset(); } + /** + * Similar to {@link #animateToFinalPosition(float)}, but used in cases where we want to + * manually set the velocity. + */ + public void animateToPositionWithVelocity(float position, float velocity) { + if (DEBUG) Log.d(TAG, "animateToPosition#velocity=" + velocity); + + setStartVelocity(velocity); + mShouldComputeVelocity = false; + animateToFinalPosition(position); + } + + public boolean isRunning() { // All the animations run at the same time so we can just check the first one. return !mAnimations.isEmpty() && mAnimations.get(0).isRunning(); @@ -153,6 +166,8 @@ public class SpringAnimationHandler<T> { } private void setStartVelocity(float velocity) { + if (DEBUG) Log.d(TAG, "setStartVelocity=" + velocity); + int size = mAnimations.size(); for (int i = 0; i < size; ++i) { mAnimations.get(i).setStartVelocity(velocity); |