Merge "Only parse LayerDrawable child items when necessary"

This commit is contained in:
Alan Viverette
2015-04-09 20:16:32 +00:00
committed by Android (Google) Code Review

View File

@@ -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) {