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

Commit fe54c368 authored by Tony Wickham's avatar Tony Wickham
Browse files

Apply PendingAnimation#mDuration to all added anims

Doing this at the root instead of individually for all added
animators ensures none fall through the cracks.

Fixes: shelf moving too quickly in 2 button mode
Change-Id: I0de1ba9cee3fb8f1d6161371625d97e4b2305129
parent db087d3c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1898,7 +1898,7 @@ public abstract class RecentsView<T extends BaseActivity> extends PagedView impl
            anim.play(depthAnimator);
        }
        anim.play(progressAnim);
        anim.setDuration(duration).setInterpolator(interpolator);
        anim.setInterpolator(interpolator);

        mPendingAnimation = new PendingAnimation(duration);
        mPendingAnimation.add(anim);
+0 −1
Original line number Diff line number Diff line
@@ -1342,7 +1342,6 @@ public class Workspace extends PagedView<WorkspacePageIndicator>

        ValueAnimator stepAnimator = ValueAnimator.ofFloat(0, 1);
        stepAnimator.addUpdateListener(listener);
        stepAnimator.setDuration(config.duration);
        stepAnimator.addListener(listener);
        animation.add(stepAnimator);
    }
+0 −1
Original line number Diff line number Diff line
@@ -189,7 +189,6 @@ public class AllAppsTransitionController implements StateHandler<LauncherState>,
                : FAST_OUT_SLOW_IN;

        Animator anim = createSpringAnimation(mProgress, targetProgress);
        anim.setDuration(config.duration);
        anim.setInterpolator(config.getInterpolator(ANIM_VERTICAL_PROGRESS, interpolator));
        anim.addListener(getProgressAnimatorListener());
        builder.add(anim);
+5 −5
Original line number Diff line number Diff line
@@ -69,7 +69,7 @@ public class PendingAnimation implements PropertySetter {
    }

    public void add(Animator a, SpringProperty springProperty) {
        mAnim.play(a);
        mAnim.play(a.setDuration(mDuration));
        addAnimationHoldersRecur(a, mDuration, springProperty, mAnimHolders);
    }

@@ -87,7 +87,7 @@ public class PendingAnimation implements PropertySetter {
        }
        ObjectAnimator anim = ObjectAnimator.ofFloat(view, View.ALPHA, alpha);
        anim.addListener(new AlphaUpdateListener(view));
        anim.setDuration(mDuration).setInterpolator(interpolator);
        anim.setInterpolator(interpolator);
        add(anim);
    }

@@ -105,7 +105,7 @@ public class PendingAnimation implements PropertySetter {
    public <T> void addFloat(T target, FloatProperty<T> property, float from, float to,
            TimeInterpolator interpolator) {
        Animator anim = ObjectAnimator.ofFloat(target, property, from, to);
        anim.setDuration(mDuration).setInterpolator(interpolator);
        anim.setInterpolator(interpolator);
        add(anim);
    }

@@ -116,7 +116,7 @@ public class PendingAnimation implements PropertySetter {
            return;
        }
        Animator anim = ObjectAnimator.ofInt(target, property, value);
        anim.setDuration(mDuration).setInterpolator(interpolator);
        anim.setInterpolator(interpolator);
        add(anim);
    }

@@ -125,7 +125,7 @@ public class PendingAnimation implements PropertySetter {
     */
    public void addOnFrameCallback(Runnable runnable) {
        if (mProgressAnimator == null) {
            mProgressAnimator = ValueAnimator.ofFloat(0, 1).setDuration(mDuration);
            mProgressAnimator = ValueAnimator.ofFloat(0, 1);
        }

        mProgressAnimator.addUpdateListener(anim -> runnable.run());