Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3ee18bf5 authored by Hyunyoung Song's avatar Hyunyoung Song Committed by Android (Google) Code Review
Browse files

Merge "Change spring effect on All Apps" into sc-dev

parents 1969cd15 4fc24284
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -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;
                }