From 4fc242847436a83b2faaa5fecc0f07d6031780b7 Mon Sep 17 00:00:00 2001 From: Hyunyoung Song Date: Wed, 21 Apr 2021 00:30:54 -0700 Subject: [PATCH] Change spring effect on All Apps Bug: 185942188 Test: Manual Change-Id: Ic460d85e19074b7f2b2adf714b211591f0d23a08 --- .../android/launcher3/allapps/AllAppsContainerView.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/com/android/launcher3/allapps/AllAppsContainerView.java b/src/com/android/launcher3/allapps/AllAppsContainerView.java index 41865ce5e2..40f7ab167c 100644 --- a/src/com/android/launcher3/allapps/AllAppsContainerView.java +++ b/src/com/android/launcher3/allapps/AllAppsContainerView.java @@ -75,8 +75,9 @@ import com.android.launcher3.workprofile.PersonalWorkSlidingTabStrip.OnActivePag public class AllAppsContainerView extends SpringRelativeLayout implements DragSource, Insettable, OnDeviceProfileChangeListener, OnActivePageChangedListener { - private static final float FLING_VELOCITY_MULTIPLIER = 1000 * .2f; - // Starts the springs after at least 55% of the animation has passed. + private static final float FLING_VELOCITY_MULTIPLIER = 1800f; + + // Starts the springs after at least 25% of the animation has passed. private static final float FLING_ANIMATION_THRESHOLD = 0.25f; protected final BaseDraggingActivity mLauncher; @@ -610,7 +611,7 @@ public class AllAppsContainerView extends SpringRelativeLayout implements DragSo public void onAnimationUpdate(ValueAnimator valueAnimator) { if (shouldSpring && valueAnimator.getAnimatedFraction() >= FLING_ANIMATION_THRESHOLD) { - absorbSwipeUpVelocity(Math.abs( + absorbSwipeUpVelocity(-Math.abs( Math.round(velocity * FLING_VELOCITY_MULTIPLIER))); shouldSpring = false; }