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
diff --git a/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java b/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java
index f27bedb..6536350 100644
--- a/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java
+++ b/quickstep/recents_ui_overrides/src/com/android/quickstep/views/RecentsView.java
@@ -1898,7 +1898,7 @@
anim.play(depthAnimator);
}
anim.play(progressAnim);
- anim.setDuration(duration).setInterpolator(interpolator);
+ anim.setInterpolator(interpolator);
mPendingAnimation = new PendingAnimation(duration);
mPendingAnimation.add(anim);
diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java
index 32685b0..f6c392b 100644
--- a/src/com/android/launcher3/Workspace.java
+++ b/src/com/android/launcher3/Workspace.java
@@ -1342,7 +1342,6 @@
ValueAnimator stepAnimator = ValueAnimator.ofFloat(0, 1);
stepAnimator.addUpdateListener(listener);
- stepAnimator.setDuration(config.duration);
stepAnimator.addListener(listener);
animation.add(stepAnimator);
}
diff --git a/src/com/android/launcher3/allapps/AllAppsTransitionController.java b/src/com/android/launcher3/allapps/AllAppsTransitionController.java
index 99ed0ad..8260336 100644
--- a/src/com/android/launcher3/allapps/AllAppsTransitionController.java
+++ b/src/com/android/launcher3/allapps/AllAppsTransitionController.java
@@ -189,7 +189,6 @@
: 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);
diff --git a/src/com/android/launcher3/anim/PendingAnimation.java b/src/com/android/launcher3/anim/PendingAnimation.java
index afeb341..4195933 100644
--- a/src/com/android/launcher3/anim/PendingAnimation.java
+++ b/src/com/android/launcher3/anim/PendingAnimation.java
@@ -69,7 +69,7 @@
}
public void add(Animator a, SpringProperty springProperty) {
- mAnim.play(a);
+ mAnim.play(a.setDuration(mDuration));
addAnimationHoldersRecur(a, mDuration, springProperty, mAnimHolders);
}
@@ -87,7 +87,7 @@
}
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 <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 @@
return;
}
Animator anim = ObjectAnimator.ofInt(target, property, value);
- anim.setDuration(mDuration).setInterpolator(interpolator);
+ anim.setInterpolator(interpolator);
add(anim);
}
@@ -125,7 +125,7 @@
*/
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());