diff options
author | Alan Viverette <alanv@google.com> | 2015-04-09 13:14:32 -0700 |
---|---|---|
committer | Alan Viverette <alanv@google.com> | 2015-04-09 13:14:32 -0700 |
commit | 45f207d6d9ccec1b9975f2ec4ca55e3c42f7bc48 (patch) | |
tree | 1015541034d2686194e1acca9411e768890781ed /graphics | |
parent | a323e3f3366321ce63d1f465d7dfe8bdc0e95679 (diff) | |
download | frameworks_base-45f207d6d9ccec1b9975f2ec4ca55e3c42f7bc48.zip frameworks_base-45f207d6d9ccec1b9975f2ec4ca55e3c42f7bc48.tar.gz frameworks_base-45f207d6d9ccec1b9975f2ec4ca55e3c42f7bc48.tar.bz2 |
Only parse LayerDrawable child items when necessary
Bug: 20098214
Change-Id: Ie9da5f6e494ede47f9fdc94481a3f8ca41d3ef00
Diffstat (limited to 'graphics')
-rw-r--r-- | graphics/java/android/graphics/drawable/LayerDrawable.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/graphics/java/android/graphics/drawable/LayerDrawable.java b/graphics/java/android/graphics/drawable/LayerDrawable.java index a2f71e5..78eee37 100644 --- a/graphics/java/android/graphics/drawable/LayerDrawable.java +++ b/graphics/java/android/graphics/drawable/LayerDrawable.java @@ -211,7 +211,11 @@ public class LayerDrawable extends Drawable implements Drawable.Callback { updateLayerFromTypedArray(layer, a); a.recycle(); - if (layer.mDrawable == null) { + // If the layer doesn't have a drawable or unresolved theme + // attribute for a drawable, attempt to parse one from the child + // element. + if (layer.mDrawable == null && (layer.mThemeAttrs == null || + layer.mThemeAttrs[R.styleable.LayerDrawableItem_drawable] == 0)) { while ((type = parser.next()) == XmlPullParser.TEXT) { } if (type != XmlPullParser.START_TAG) { |