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

Commit d2f50c78 authored by ztenghui's avatar ztenghui
Browse files

AVD: Deep copy the animator target setup when mutate.

Only calling VectorDrawable's mutate here will miss all the animator setup,
when the VectorDrawable has a new state.
So we just deep copy everything and setup the animators again.

b/18521582

Change-Id: Id164312750bb548f9c2d21cc0b5806cd2bafcf0d
parent 2705387d
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -146,7 +146,8 @@ public class AnimatedVectorDrawable extends Drawable implements Animatable {
    @Override
    public Drawable mutate() {
        if (!mMutated && super.mutate() == this) {
            mAnimatedVectorState.mVectorDrawable.mutate();
            mAnimatedVectorState = new AnimatedVectorDrawableState(
                    mAnimatedVectorState, mCallback, null);
            mMutated = true;
        }
        return this;