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

Commit 0eba1dfb authored by George Mount's avatar George Mount
Browse files

Notify end animation after setting the state to not running.

Bug 28404635

Change-Id: I13a480b54bb652e52d6b36addfe6d3799ece7568
parent 648d636d
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -819,6 +819,8 @@ public final class AnimatorSet extends Animator {
                }
                }
            }
            }
            if (allDone) {
            if (allDone) {
                mStarted = false;
                mPaused = false;
                // If this was the last child animation to end, then notify listeners that this
                // If this was the last child animation to end, then notify listeners that this
                // AnimatorSet has ended
                // AnimatorSet has ended
                if (mListeners != null) {
                if (mListeners != null) {
@@ -829,8 +831,6 @@ public final class AnimatorSet extends Animator {
                        tmpListeners.get(i).onAnimationEnd(this);
                        tmpListeners.get(i).onAnimationEnd(this);
                    }
                    }
                }
                }
                mStarted = false;
                mPaused = false;
            }
            }
        }
        }
    }
    }
+11 −10
Original line number Original line Diff line number Diff line
@@ -1137,11 +1137,17 @@ public class ValueAnimator extends Animator implements AnimationHandler.Animatio


        mAnimationEndRequested = true;
        mAnimationEndRequested = true;
        mPaused = false;
        mPaused = false;
        if ((mStarted || mRunning) && mListeners != null) {
        boolean notify = (mStarted || mRunning) && mListeners != null;
            if (!mRunning) {
        if (notify && !mRunning) {
            // If it's not yet running, then start listeners weren't called. Call them now.
            // If it's not yet running, then start listeners weren't called. Call them now.
            notifyStartListeners();
            notifyStartListeners();
        }
        }
        mRunning = false;
        mStarted = false;
        mStartListenersCalled = false;
        mReversing = false;
        mLastFrameTime = 0;
        if (notify && mListeners != null) {
            ArrayList<AnimatorListener> tmpListeners =
            ArrayList<AnimatorListener> tmpListeners =
                    (ArrayList<AnimatorListener>) mListeners.clone();
                    (ArrayList<AnimatorListener>) mListeners.clone();
            int numListeners = tmpListeners.size();
            int numListeners = tmpListeners.size();
@@ -1149,11 +1155,6 @@ public class ValueAnimator extends Animator implements AnimationHandler.Animatio
                tmpListeners.get(i).onAnimationEnd(this);
                tmpListeners.get(i).onAnimationEnd(this);
            }
            }
        }
        }
        mRunning = false;
        mStarted = false;
        mStartListenersCalled = false;
        mReversing = false;
        mLastFrameTime = 0;
        if (Trace.isTagEnabled(Trace.TRACE_TAG_VIEW)) {
        if (Trace.isTagEnabled(Trace.TRACE_TAG_VIEW)) {
            Trace.asyncTraceEnd(Trace.TRACE_TAG_VIEW, getNameForTrace(),
            Trace.asyncTraceEnd(Trace.TRACE_TAG_VIEW, getNameForTrace(),
                    System.identityHashCode(this));
                    System.identityHashCode(this));