Fix ColorStateListDrawable bounds handling

The inner Drawable was never updated.

Bug: 135592087

Test: atest ColorStateListDrawableTest
Test: manual test valid ColorStateList XML in res/color

Change-Id: If922acd3054ded7cc068241376ebf7017e1ff6ff
This commit is contained in:
Winson
2019-06-19 16:26:50 -07:00
parent 6210ac615e
commit eca29cf944

View File

@@ -25,6 +25,7 @@ import android.graphics.BlendMode;
import android.graphics.Canvas;
import android.graphics.ColorFilter;
import android.graphics.PixelFormat;
import android.graphics.Rect;
import android.util.MathUtils;
/**
@@ -135,6 +136,12 @@ public class ColorStateListDrawable extends Drawable implements Drawable.Callbac
return mColorDrawable.getOpacity();
}
@Override
protected void onBoundsChange(Rect bounds) {
super.onBoundsChange(bounds);
mColorDrawable.setBounds(bounds);
}
@Override
protected boolean onStateChange(int[] state) {
if (mState.mColor != null) {