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

Commit 0b6b0fa1 authored by Alan Viverette's avatar Alan Viverette Committed by Android Git Automerger
Browse files

am 0660042a: Merge "Mutate and apply theme if needed before caching themed...

am 0660042a: Merge "Mutate and apply theme if needed before caching themed drawables" into lmp-mr1-dev

* commit '0660042a':
  Mutate and apply theme if needed before caching themed drawables
parents a9dd05cd 0660042a
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -2323,7 +2323,14 @@ public class Resources {

        final Drawable dr;
        if (cs != null) {
            dr = cs.newDrawable(this, theme);
            final Drawable clonedDr = cs.newDrawable(this);
            if (theme != null) {
                dr = clonedDr.mutate();
                dr.applyTheme(theme);
                dr.clearMutated();
            } else {
                dr = clonedDr;
            }
        } else if (isColorDrawable) {
            dr = new ColorDrawable(value.data);
        } else {
+9 −0
Original line number Diff line number Diff line
@@ -331,6 +331,15 @@ public class AnimatedRotateDrawable extends Drawable implements Drawable.Callbac
        return this;
    }

    /**
     * @hide
     */
    public void clearMutated() {
        super.clearMutated();
        mState.mDrawable.clearMutated();
        mMutated = false;
    }

    final static class AnimatedRotateState extends Drawable.ConstantState {
        Drawable mDrawable;

+8 −0
Original line number Diff line number Diff line
@@ -507,6 +507,14 @@ public class AnimatedStateListDrawable extends StateListDrawable {
        return this;
    }

    /**
     * @hide
     */
    public void clearMutated() {
        super.clearMutated();
        mMutated = false;
    }

    static class AnimatedStateListState extends StateListState {
        private static final int REVERSE_SHIFT = 32;
        private static final int REVERSE_MASK = 0x1;
+9 −0
Original line number Diff line number Diff line
@@ -157,6 +157,15 @@ public class AnimatedVectorDrawable extends Drawable implements Animatable {
        return this;
    }

    /**
     * @hide
     */
    public void clearMutated() {
        super.clearMutated();
        mAnimatedVectorState.mVectorDrawable.clearMutated();
        mMutated = false;
    }

    @Override
    public ConstantState getConstantState() {
        mAnimatedVectorState.mChangingConfigurations = getChangingConfigurations();
+8 −0
Original line number Diff line number Diff line
@@ -347,6 +347,14 @@ public class AnimationDrawable extends DrawableContainer implements Runnable, An
        return this;
    }

    /**
     * @hide
     */
    public void clearMutated() {
        super.clearMutated();
        mMutated = false;
    }

    private final static class AnimationState extends DrawableContainerState {
        private int[] mDurations;
        private boolean mOneShot;
Loading