Commit 80d4ae2e authored by Winson Chung's avatar Winson Chung Committed by Android Git Automerger
Browse files

am 6b0d58c1: Ensure that FirstFrameAnimatorHelper doesn\'t set play time when animation is complete

* commit '6b0d58c1':
  Ensure that FirstFrameAnimatorHelper doesn't set play time when animation is complete
parents 397c84a0 6b0d58c1
......@@ -91,12 +91,14 @@ public class FirstFrameAnimatorHelper extends AnimatorListenerAdapter
mStartTime = currentTime;
}
boolean isFinalFrame = Float.compare(1f, animation.getAnimatedFraction()) == 0;
if (!mHandlingOnAnimationUpdate &&
sVisible &&
// If the current play time exceeds the duration, the animation
// will get finished, even if we call setCurrentPlayTime -- therefore
// If the current play time exceeds the duration, or the animated fraction is 1,
// the animation will get finished, even if we call setCurrentPlayTime -- therefore
// don't adjust the animation in that case
animation.getCurrentPlayTime() < animation.getDuration()) {
animation.getCurrentPlayTime() < animation.getDuration() && !isFinalFrame) {
mHandlingOnAnimationUpdate = true;
long frameNum = sGlobalFrameCounter - mStartFrame;
// If we haven't drawn our first frame, reset the time to t = 0
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment