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

Commit 79dbddef authored by Alan Viverette's avatar Alan Viverette Committed by Android Git Automerger
Browse files

am 79bd9953: Merge "Preserve inner drawable bounds and level on mutate" into lmp-dev

* commit '79bd9953b25bb7be002784ecddaa15bcf14b806a':
  Preserve inner drawable bounds and level on mutate
parents e76d4e26 327710e3
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -17,7 +17,8 @@
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:id="@id/background">
        <nine-patch android:src="@drawable/progress_mtrl_alpha"
            android:tint="?attr/colorControlNormal" />
            android:tint="?attr/colorControlNormal"
            android:alpha="0.5" />
    </item>
    <item android:id="@id/secondaryProgress">
        <scale android:scaleWidth="100%">
+13 −11
Original line number Diff line number Diff line
@@ -346,22 +346,24 @@ public class AnimatedRotateDrawable extends Drawable implements Drawable.Callbac
        private boolean mCanConstantState;
        private boolean mCheckedConstantState;

        public AnimatedRotateState(AnimatedRotateState source, AnimatedRotateDrawable owner,
        public AnimatedRotateState(AnimatedRotateState orig, AnimatedRotateDrawable owner,
                Resources res) {
            if (source != null) {
            if (orig != null) {
                if (res != null) {
                    mDrawable = source.mDrawable.getConstantState().newDrawable(res);
                    mDrawable = orig.mDrawable.getConstantState().newDrawable(res);
                } else {
                    mDrawable = source.mDrawable.getConstantState().newDrawable();
                    mDrawable = orig.mDrawable.getConstantState().newDrawable();
                }
                mDrawable.setCallback(owner);
                mDrawable.setLayoutDirection(source.mDrawable.getLayoutDirection());
                mPivotXRel = source.mPivotXRel;
                mPivotX = source.mPivotX;
                mPivotYRel = source.mPivotYRel;
                mPivotY = source.mPivotY;
                mFramesCount = source.mFramesCount;
                mFrameDuration = source.mFrameDuration;
                mDrawable.setLayoutDirection(orig.mDrawable.getLayoutDirection());
                mDrawable.setBounds(orig.mDrawable.getBounds());
                mDrawable.setLevel(orig.mDrawable.getLevel());
                mPivotXRel = orig.mPivotXRel;
                mPivotX = orig.mPivotX;
                mPivotYRel = orig.mPivotYRel;
                mPivotY = orig.mPivotY;
                mFramesCount = orig.mFramesCount;
                mFrameDuration = orig.mFrameDuration;
                mCanConstantState = mCheckedConstantState = true;
            }
        }
+2 −0
Original line number Diff line number Diff line
@@ -285,6 +285,8 @@ public class ClipDrawable extends Drawable implements Drawable.Callback {
                }
                mDrawable.setCallback(owner);
                mDrawable.setLayoutDirection(orig.mDrawable.getLayoutDirection());
                mDrawable.setBounds(orig.mDrawable.getBounds());
                mDrawable.setLevel(orig.mDrawable.getLevel());
                mOrientation = orig.mOrientation;
                mGravity = orig.mGravity;
                mCheckedConstantState = mCanConstantState = true;
+2 −0
Original line number Diff line number Diff line
@@ -400,6 +400,8 @@ public class InsetDrawable extends Drawable implements Drawable.Callback {
                }
                mDrawable.setCallback(owner);
                mDrawable.setLayoutDirection(orig.mDrawable.getLayoutDirection());
                mDrawable.setBounds(orig.mDrawable.getBounds());
                mDrawable.setLevel(orig.mDrawable.getLevel());
                mInsetLeft = orig.mInsetLeft;
                mInsetTop = orig.mInsetTop;
                mInsetRight = orig.mInsetRight;
+12 −10
Original line number Diff line number Diff line
@@ -961,20 +961,22 @@ public class LayerDrawable extends Drawable implements Drawable.Callback {
            // Default empty constructor.
        }

        ChildDrawable(ChildDrawable or, LayerDrawable owner, Resources res) {
        ChildDrawable(ChildDrawable orig, LayerDrawable owner, Resources res) {
            if (res != null) {
                mDrawable = or.mDrawable.getConstantState().newDrawable(res);
                mDrawable = orig.mDrawable.getConstantState().newDrawable(res);
            } else {
                mDrawable = or.mDrawable.getConstantState().newDrawable();
                mDrawable = orig.mDrawable.getConstantState().newDrawable();
            }
            mDrawable.setCallback(owner);
            mDrawable.setLayoutDirection(or.mDrawable.getLayoutDirection());
            mThemeAttrs = or.mThemeAttrs;
            mInsetL = or.mInsetL;
            mInsetT = or.mInsetT;
            mInsetR = or.mInsetR;
            mInsetB = or.mInsetB;
            mId = or.mId;
            mDrawable.setLayoutDirection(orig.mDrawable.getLayoutDirection());
            mDrawable.setBounds(orig.mDrawable.getBounds());
            mDrawable.setLevel(orig.mDrawable.getLevel());
            mThemeAttrs = orig.mThemeAttrs;
            mInsetL = orig.mInsetL;
            mInsetT = orig.mInsetT;
            mInsetR = orig.mInsetR;
            mInsetB = orig.mInsetB;
            mId = orig.mId;
        }
    }

Loading