Clear the promise flag once the restore animation is run

and no more restore related tasks are pending

issue: 17214102

Change-Id: I54c486ff001d74b4961f85947f41848cf92243a3
This commit is contained in:
Sunny Goyal
2014-08-25 16:02:46 -07:00
parent d5058a534e
commit 4f88bfb7af
2 changed files with 8 additions and 4 deletions

View File

@@ -189,10 +189,11 @@ class PreloadIconDrawable extends Drawable {
/**
* Runs the finish animation if it is has not been run after last level change.
* @return true if the animation was run.
*/
public void maybePerformFinishedAnimation() {
public boolean maybePerformFinishedAnimation() {
if (mAnimationProgress > ANIMATION_PROGRESS_STOPPED) {
return;
return false;
}
if (mAnimator != null) {
mAnimator.cancel();
@@ -201,6 +202,7 @@ class PreloadIconDrawable extends Drawable {
mAnimator = ObjectAnimator.ofFloat(this, "animationProgress",
ANIMATION_PROGRESS_STARTED, ANIMATION_PROGRESS_COMPLETED);
mAnimator.start();
return true;
}
public void setAnimationProgress(float progress) {