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

Commit db02b113 authored by Jon Miranda's avatar Jon Miranda Committed by Jonathan Miranda
Browse files

Ensure final values are set when StaggeredWorkspaceAnim is cancelled/ended.

Was able to repo the bug reliably when calling cancel() and
end() immediately after starting the StaggeredWorkspaceAnim.

Bug: 153584267
Change-Id: I954d38ad69e72a83535f4dd1ec21dba0f61a3cfb
parent 5111df54
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -202,6 +202,12 @@ public class StaggeredWorkspaceAnim {
        alpha.setInterpolator(LINEAR);
        alpha.setDuration(ALPHA_DURATION_MS);
        alpha.setStartDelay(startDelay);
        alpha.addListener(new AnimatorListenerAdapter() {
            @Override
            public void onAnimationEnd(Animator animation) {
                v.setAlpha(1f);
            }
        });
        mAnimators.play(alpha);
    }

+8 −0
Original line number Diff line number Diff line
@@ -17,6 +17,8 @@ package com.android.launcher3.anim;

import static com.android.launcher3.anim.Interpolators.LINEAR;

import android.animation.Animator;
import android.animation.AnimatorListenerAdapter;
import android.animation.ValueAnimator;
import android.content.Context;
import android.util.FloatProperty;
@@ -195,6 +197,12 @@ public class SpringAnimationBuilder {
        animator.setDuration(getDuration()).setInterpolator(LINEAR);
        animator.addUpdateListener(anim ->
                property.set(target, getInterpolatedValue(anim.getAnimatedFraction())));
        animator.addListener(new AnimatorListenerAdapter() {
            @Override
            public void onAnimationEnd(Animator animation) {
                property.set(target, mEndValue);
            }
        });
        return animator;
    }