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

Commit d54498fb authored by Lais Andrade's avatar Lais Andrade Committed by Automerger Merge Worker
Browse files

Merge "Change variable name fix from 'endingListener' to 'endListener'" am: af1750e9

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1386076

Change-Id: Ib4c3064ef0bdd28c2fb7ecc4c70215c19e6e618c
parents b541b5fe af1750e9
Loading
Loading
Loading
Loading
+9 −9
Original line number Original line Diff line number Diff line
@@ -183,7 +183,7 @@ public final class AnimatorSet extends Animator implements AnimationHandler.Anim


    // This is to work around a bug in b/34736819. This needs to be removed once app team
    // This is to work around a bug in b/34736819. This needs to be removed once app team
    // fixes their side.
    // fixes their side.
    private AnimatorListenerAdapter mAnimationEndingListener = new AnimatorListenerAdapter() {
    private AnimatorListenerAdapter mAnimationEndListener = new AnimatorListenerAdapter() {
        @Override
        @Override
        public void onAnimationEnd(Animator animation) {
        public void onAnimationEnd(Animator animation) {
            if (mNodeMap.get(animation) == null) {
            if (mNodeMap.get(animation) == null) {
@@ -1186,7 +1186,7 @@ public final class AnimatorSet extends Animator implements AnimationHandler.Anim
    }
    }


    private void startAnimation() {
    private void startAnimation() {
        addAnimationEndingListener();
        addAnimationEndListener();


        // Register animation callback
        // Register animation callback
        addAnimationCallback(0);
        addAnimationCallback(0);
@@ -1243,15 +1243,15 @@ public final class AnimatorSet extends Animator implements AnimationHandler.Anim


    // This is to work around the issue in b/34736819, as the old behavior in AnimatorSet had
    // This is to work around the issue in b/34736819, as the old behavior in AnimatorSet had
    // masked a real bug in play movies. TODO: remove this and below once the root cause is fixed.
    // masked a real bug in play movies. TODO: remove this and below once the root cause is fixed.
    private void addAnimationEndingListener() {
    private void addAnimationEndListener() {
        for (int i = 1; i < mNodes.size(); i++) {
        for (int i = 1; i < mNodes.size(); i++) {
            mNodes.get(i).mAnimation.addListener(mAnimationEndingListener);
            mNodes.get(i).mAnimation.addListener(mAnimationEndListener);
        }
        }
    }
    }


    private void removeAnimationEndingListener() {
    private void removeAnimationEndListener() {
        for (int i = 1; i < mNodes.size(); i++) {
        for (int i = 1; i < mNodes.size(); i++) {
            mNodes.get(i).mAnimation.removeListener(mAnimationEndingListener);
            mNodes.get(i).mAnimation.removeListener(mAnimationEndListener);
        }
        }
    }
    }


@@ -1301,7 +1301,7 @@ public final class AnimatorSet extends Animator implements AnimationHandler.Anim
                tmpListeners.get(i).onAnimationEnd(this, mReversing);
                tmpListeners.get(i).onAnimationEnd(this, mReversing);
            }
            }
        }
        }
        removeAnimationEndingListener();
        removeAnimationEndListener();
        mSelfPulse = true;
        mSelfPulse = true;
        mReversing = false;
        mReversing = false;
    }
    }
@@ -1346,7 +1346,7 @@ public final class AnimatorSet extends Animator implements AnimationHandler.Anim
        anim.mNodeMap = new ArrayMap<Animator, Node>();
        anim.mNodeMap = new ArrayMap<Animator, Node>();
        anim.mNodes = new ArrayList<Node>(nodeCount);
        anim.mNodes = new ArrayList<Node>(nodeCount);
        anim.mEvents = new ArrayList<AnimationEvent>();
        anim.mEvents = new ArrayList<AnimationEvent>();
        anim.mAnimationEndingListener = new AnimatorListenerAdapter() {
        anim.mAnimationEndListener = new AnimatorListenerAdapter() {
            @Override
            @Override
            public void onAnimationEnd(Animator animation) {
            public void onAnimationEnd(Animator animation) {
                if (anim.mNodeMap.get(animation) == null) {
                if (anim.mNodeMap.get(animation) == null) {
@@ -1369,7 +1369,7 @@ public final class AnimatorSet extends Animator implements AnimationHandler.Anim
            final Node node = mNodes.get(n);
            final Node node = mNodes.get(n);
            Node nodeClone = node.clone();
            Node nodeClone = node.clone();
            // Remove the old internal listener from the cloned child
            // Remove the old internal listener from the cloned child
            nodeClone.mAnimation.removeListener(mAnimationEndingListener);
            nodeClone.mAnimation.removeListener(mAnimationEndListener);
            clonesMap.put(node, nodeClone);
            clonesMap.put(node, nodeClone);
            anim.mNodes.add(nodeClone);
            anim.mNodes.add(nodeClone);
            anim.mNodeMap.put(nodeClone.mAnimation, nodeClone);
            anim.mNodeMap.put(nodeClone.mAnimation, nodeClone);