Merge "Reapply animation duration scale each time it is started." into lmp-dev

This commit is contained in:
Jeff Brown
2014-10-07 23:53:20 +00:00
committed by Android (Google) Code Review

View File

@@ -508,10 +508,14 @@ public class ValueAnimator extends Animator {
duration);
}
mUnscaledDuration = duration;
mDuration = (long)(duration * sDurationScale);
updateScaledDuration();
return this;
}
private void updateScaledDuration() {
mDuration = (long)(mUnscaledDuration * sDurationScale);
}
/**
* Gets the length of the animation. The default duration is 300 milliseconds.
*
@@ -947,6 +951,7 @@ public class ValueAnimator extends Animator {
mStarted = true;
mStartedDelay = false;
mPaused = false;
updateScaledDuration(); // in case the scale factor has changed since creation time
AnimationHandler animationHandler = getOrCreateAnimationHandler();
animationHandler.mPendingAnimations.add(this);
if (mStartDelay == 0) {