Handle nullable drawables inside MaskableIconDrawable
Test: manual test b/34902453 Change-Id: I36fc48f7e4c1f6503a9c26b8f239c62da729b490
This commit is contained in:
@@ -726,6 +726,9 @@ public class MaskableIconDrawable extends Drawable implements Drawable.Callback
|
||||
int width = -1;
|
||||
for (int i = 0; i < mLayerState.N_CHILDREN; i++) {
|
||||
final ChildDrawable r = mLayerState.mChildren[i];
|
||||
if (r.mDrawable == null) {
|
||||
continue;
|
||||
}
|
||||
final int w = r.mDrawable.getIntrinsicWidth();
|
||||
if (w > width) {
|
||||
width = w;
|
||||
@@ -743,6 +746,9 @@ public class MaskableIconDrawable extends Drawable implements Drawable.Callback
|
||||
int height = -1;
|
||||
for (int i = 0; i < mLayerState.N_CHILDREN; i++) {
|
||||
final ChildDrawable r = mLayerState.mChildren[i];
|
||||
if (r.mDrawable == null) {
|
||||
continue;
|
||||
}
|
||||
final int h = r.mDrawable.getIntrinsicHeight();
|
||||
if (h > height) {
|
||||
height = h;
|
||||
|
||||
Reference in New Issue
Block a user