diff options
author | Adam Cohen <adamcohen@google.com> | 2014-12-02 15:24:52 -0800 |
---|---|---|
committer | Danesh M <daneshm90@gmail.com> | 2015-09-27 21:08:01 -0700 |
commit | 45f5f45d36514d36063704a38674cf29a00c9bd7 (patch) | |
tree | 21b551b8b75370ae1ff01387cac9b4e7d7dbd69e | |
parent | 6238f10efa9b29c5a799982e1f1b892410f816f1 (diff) | |
download | packages_apps_Trebuchet-45f5f45d36514d36063704a38674cf29a00c9bd7.tar.gz packages_apps_Trebuchet-45f5f45d36514d36063704a38674cf29a00c9bd7.tar.bz2 packages_apps_Trebuchet-45f5f45d36514d36063704a38674cf29a00c9bd7.zip |
Ensure that FirstFrameAnimatorHelper doesn't set play time when animation is complete
Bug: 18567716
Change-Id: I656e869b8553d650916c2abe6dc83282c8b6fd65
-rw-r--r-- | src/com/android/launcher3/FirstFrameAnimatorHelper.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/com/android/launcher3/FirstFrameAnimatorHelper.java b/src/com/android/launcher3/FirstFrameAnimatorHelper.java index f4c49d77a..095c5631d 100644 --- a/src/com/android/launcher3/FirstFrameAnimatorHelper.java +++ b/src/com/android/launcher3/FirstFrameAnimatorHelper.java @@ -92,12 +92,14 @@ public class FirstFrameAnimatorHelper extends AnimatorListenerAdapter } final long currentPlayTime = animation.getCurrentPlayTime(); + 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 - currentPlayTime < animation.getDuration()) { + currentPlayTime < animation.getDuration() && !isFinalFrame) { mHandlingOnAnimationUpdate = true; long frameNum = sGlobalFrameCounter - mStartFrame; // If we haven't drawn our first frame, reset the time to t = 0 |