Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d750f8b3 authored by Sunny Goyal's avatar Sunny Goyal Committed by Android (Google) Code Review
Browse files

Merge "Clear the promise flag once the restore animation is run and no more...

Merge "Clear the promise flag once the restore animation is run and no more restore related tasks are pending" into ub-now-porkchop
parents 83acc755 4f88bfb7
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -415,8 +415,10 @@ public class BubbleTextView extends TextView {
                }

                preloadDrawable.setLevel(progressLevel);
                if (state == ShortcutInfo.PACKAGE_STATE_DEFAULT) {
                    preloadDrawable.maybePerformFinishedAnimation();
                if ((state == ShortcutInfo.PACKAGE_STATE_DEFAULT) && info.wasPromise) {
                    // Clear the promise flag as it is no longer different than a normal shortcut,
                    // once the animation has been run.
                    info.wasPromise = !preloadDrawable.maybePerformFinishedAnimation();
                }

            }
+4 −2
Original line number Diff line number Diff line
@@ -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) {