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

Commit 6579f509 authored by Adam Powell's avatar Adam Powell
Browse files

Fix default gravity for View foreground drawables

Use the expected default gravity of Gravity.FILL as FrameLayout used
to do. Reset the bounds correctly when a new drawable is set.

Bug 19922909

Change-Id: I80181923c37e33ba308e364e322d84f3cc86e93b
parent 99e046b2
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -3195,9 +3195,9 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
    private static class ForegroundInfo {
        private Drawable mDrawable;
        private TintInfo mTintInfo;
        private int mGravity = Gravity.START | Gravity.TOP;
        private int mGravity = Gravity.FILL;
        private boolean mInsidePadding = true;
        private boolean mBoundsChanged;
        private boolean mBoundsChanged = true;
        private final Rect mSelfBounds = new Rect();
        private final Rect mOverlayBounds = new Rect();
    }
@@ -16663,6 +16663,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
        }
        mForegroundInfo.mDrawable = foreground;
        mForegroundInfo.mBoundsChanged = true;
        if (foreground != null) {
            setWillNotDraw(false);
            foreground.setCallback(this);