Merge "Ensure final values are set when StaggeredWorkspaceAnim is cancelled/ended." into ub-launcher3-rvc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
7a79edd48a
+6
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user