diff options
author | Adam Cohen <adamcohen@google.com> | 2014-12-02 15:24:52 -0800 |
---|---|---|
committer | Adam Cohen <adamcohen@google.com> | 2014-12-04 17:21:12 +0000 |
commit | 268b8907d1f2fcf9775880c69899b3c6fbe85ea3 (patch) | |
tree | 001923b342aa8fef6a653400ff3bc24d6d6c6941 | |
parent | ae5f7ce8ed2e385cba8d65a67d9b108c9c3590e8 (diff) | |
download | android_packages_apps_Trebuchet-268b8907d1f2fcf9775880c69899b3c6fbe85ea3.tar.gz android_packages_apps_Trebuchet-268b8907d1f2fcf9775880c69899b3c6fbe85ea3.tar.bz2 android_packages_apps_Trebuchet-268b8907d1f2fcf9775880c69899b3c6fbe85ea3.zip |
Ensure that FirstFrameAnimatorHelper doesn't set play time when animation is complete
Bug: 18567716
Change-Id: I656e869b8553d650916c2abe6dc83282c8b6fd65
(cherry picked from commit 5c18b80ed9aaa57b27b56667e3699fd76bcce8ed)
-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 |