Merge "Apply PendingAnimation#mDuration to all added anims" into ub-launcher3-rvc-dev

This commit is contained in:
TreeHugger Robot 2020-06-10 00:18:31 +00:00 committed by Android (Google) Code Review
commit 8984fea211
4 changed files with 6 additions and 8 deletions

View File

@ -1904,7 +1904,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);

View File

@ -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);
}

View File

@ -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);

View File

@ -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());