From 39e33621a725bcdaa21a723866e53c6ea3356169 Mon Sep 17 00:00:00 2001 From: Alan Viverette Date: Thu, 2 Oct 2014 15:53:31 -0700 Subject: Fix theme propagation to contained android:drawable elements BUG: 17790666 Change-Id: I6733a98e779cad0d384b917c57d2b3409a166c02 --- graphics/java/android/graphics/drawable/AnimatedRotateDrawable.java | 2 +- .../java/android/graphics/drawable/AnimatedStateListDrawable.java | 3 ++- graphics/java/android/graphics/drawable/AnimationDrawable.java | 5 +++-- graphics/java/android/graphics/drawable/ClipDrawable.java | 3 ++- graphics/java/android/graphics/drawable/InsetDrawable.java | 2 +- graphics/java/android/graphics/drawable/LevelListDrawable.java | 2 +- graphics/java/android/graphics/drawable/RotateDrawable.java | 2 +- graphics/java/android/graphics/drawable/ScaleDrawable.java | 3 ++- graphics/java/android/graphics/drawable/StateListDrawable.java | 2 +- 9 files changed, 14 insertions(+), 10 deletions(-) (limited to 'graphics/java') diff --git a/graphics/java/android/graphics/drawable/AnimatedRotateDrawable.java b/graphics/java/android/graphics/drawable/AnimatedRotateDrawable.java index 4c8b4f1..9fb3fb4 100644 --- a/graphics/java/android/graphics/drawable/AnimatedRotateDrawable.java +++ b/graphics/java/android/graphics/drawable/AnimatedRotateDrawable.java @@ -257,7 +257,7 @@ public class AnimatedRotateDrawable extends Drawable implements Drawable.Callbac public void inflate(Resources r, XmlPullParser parser, AttributeSet attrs, Theme theme) throws XmlPullParserException, IOException { - final TypedArray a = r.obtainAttributes(attrs, R.styleable.AnimatedRotateDrawable); + final TypedArray a = obtainAttributes(r, theme, attrs, R.styleable.AnimatedRotateDrawable); super.inflateWithAttributes(r, parser, a, R.styleable.AnimatedRotateDrawable_visible); diff --git a/graphics/java/android/graphics/drawable/AnimatedStateListDrawable.java b/graphics/java/android/graphics/drawable/AnimatedStateListDrawable.java index d78138bc..cb09bbf 100644 --- a/graphics/java/android/graphics/drawable/AnimatedStateListDrawable.java +++ b/graphics/java/android/graphics/drawable/AnimatedStateListDrawable.java @@ -357,7 +357,8 @@ public class AnimatedStateListDrawable extends StateListDrawable { public void inflate(@NonNull Resources r, @NonNull XmlPullParser parser, @NonNull AttributeSet attrs, @Nullable Theme theme) throws XmlPullParserException, IOException { - final TypedArray a = r.obtainAttributes(attrs, R.styleable.AnimatedStateListDrawable); + final TypedArray a = obtainAttributes( + r, theme, attrs, R.styleable.AnimatedStateListDrawable); super.inflateWithAttributes(r, parser, a, R.styleable.AnimatedStateListDrawable_visible); diff --git a/graphics/java/android/graphics/drawable/AnimationDrawable.java b/graphics/java/android/graphics/drawable/AnimationDrawable.java index d87e8e4..9a9fd82 100644 --- a/graphics/java/android/graphics/drawable/AnimationDrawable.java +++ b/graphics/java/android/graphics/drawable/AnimationDrawable.java @@ -272,7 +272,7 @@ public class AnimationDrawable extends DrawableContainer implements Runnable, An public void inflate(Resources r, XmlPullParser parser, AttributeSet attrs, Theme theme) throws XmlPullParserException, IOException { - TypedArray a = r.obtainAttributes(attrs, + TypedArray a = obtainAttributes(r, theme, attrs, com.android.internal.R.styleable.AnimationDrawable); super.inflateWithAttributes(r, parser, a, @@ -300,7 +300,8 @@ public class AnimationDrawable extends DrawableContainer implements Runnable, An continue; } - a = r.obtainAttributes(attrs, com.android.internal.R.styleable.AnimationDrawableItem); + a = obtainAttributes( + r, theme, attrs, com.android.internal.R.styleable.AnimationDrawableItem); int duration = a.getInt( com.android.internal.R.styleable.AnimationDrawableItem_duration, -1); if (duration < 0) { diff --git a/graphics/java/android/graphics/drawable/ClipDrawable.java b/graphics/java/android/graphics/drawable/ClipDrawable.java index 61ef81b..40711cf 100644 --- a/graphics/java/android/graphics/drawable/ClipDrawable.java +++ b/graphics/java/android/graphics/drawable/ClipDrawable.java @@ -81,7 +81,8 @@ public class ClipDrawable extends Drawable implements Drawable.Callback { int type; - TypedArray a = r.obtainAttributes(attrs, com.android.internal.R.styleable.ClipDrawable); + TypedArray a = obtainAttributes( + r, theme, attrs, com.android.internal.R.styleable.ClipDrawable); int orientation = a.getInt( com.android.internal.R.styleable.ClipDrawable_clipOrientation, diff --git a/graphics/java/android/graphics/drawable/InsetDrawable.java b/graphics/java/android/graphics/drawable/InsetDrawable.java index 384226f..961d160 100644 --- a/graphics/java/android/graphics/drawable/InsetDrawable.java +++ b/graphics/java/android/graphics/drawable/InsetDrawable.java @@ -84,7 +84,7 @@ public class InsetDrawable extends Drawable implements Drawable.Callback { @Override public void inflate(Resources r, XmlPullParser parser, AttributeSet attrs, Theme theme) throws XmlPullParserException, IOException { - final TypedArray a = r.obtainAttributes(attrs, R.styleable.InsetDrawable); + final TypedArray a = obtainAttributes(r, theme, attrs, R.styleable.InsetDrawable); super.inflateWithAttributes(r, parser, a, R.styleable.InsetDrawable_visible); mInsetState.mDrawable = null; diff --git a/graphics/java/android/graphics/drawable/LevelListDrawable.java b/graphics/java/android/graphics/drawable/LevelListDrawable.java index 7271b0e..bc1c61d 100644 --- a/graphics/java/android/graphics/drawable/LevelListDrawable.java +++ b/graphics/java/android/graphics/drawable/LevelListDrawable.java @@ -105,7 +105,7 @@ public class LevelListDrawable extends DrawableContainer { continue; } - TypedArray a = r.obtainAttributes(attrs, + TypedArray a = obtainAttributes(r, theme, attrs, com.android.internal.R.styleable.LevelListDrawableItem); low = a.getInt( diff --git a/graphics/java/android/graphics/drawable/RotateDrawable.java b/graphics/java/android/graphics/drawable/RotateDrawable.java index 70482a6..55c9637 100644 --- a/graphics/java/android/graphics/drawable/RotateDrawable.java +++ b/graphics/java/android/graphics/drawable/RotateDrawable.java @@ -399,7 +399,7 @@ public class RotateDrawable extends Drawable implements Drawable.Callback { @Override public void inflate(Resources r, XmlPullParser parser, AttributeSet attrs, Theme theme) throws XmlPullParserException, IOException { - final TypedArray a = r.obtainAttributes(attrs, + final TypedArray a = obtainAttributes(r, theme, attrs, com.android.internal.R.styleable.RotateDrawable); super.inflateWithAttributes(r, parser, a, diff --git a/graphics/java/android/graphics/drawable/ScaleDrawable.java b/graphics/java/android/graphics/drawable/ScaleDrawable.java index b40038a..b990249 100644 --- a/graphics/java/android/graphics/drawable/ScaleDrawable.java +++ b/graphics/java/android/graphics/drawable/ScaleDrawable.java @@ -93,7 +93,8 @@ public class ScaleDrawable extends Drawable implements Drawable.Callback { int type; - TypedArray a = r.obtainAttributes(attrs, com.android.internal.R.styleable.ScaleDrawable); + TypedArray a = obtainAttributes( + r, theme, attrs, com.android.internal.R.styleable.ScaleDrawable); float sw = getPercent(a, com.android.internal.R.styleable.ScaleDrawable_scaleWidth); float sh = getPercent(a, com.android.internal.R.styleable.ScaleDrawable_scaleHeight); diff --git a/graphics/java/android/graphics/drawable/StateListDrawable.java b/graphics/java/android/graphics/drawable/StateListDrawable.java index 4c513e9..2eb8a80 100644 --- a/graphics/java/android/graphics/drawable/StateListDrawable.java +++ b/graphics/java/android/graphics/drawable/StateListDrawable.java @@ -118,7 +118,7 @@ public class StateListDrawable extends DrawableContainer { public void inflate(Resources r, XmlPullParser parser, AttributeSet attrs, Theme theme) throws XmlPullParserException, IOException { - final TypedArray a = r.obtainAttributes(attrs, R.styleable.StateListDrawable); + final TypedArray a = obtainAttributes(r, theme, attrs, R.styleable.StateListDrawable); super.inflateWithAttributes(r, parser, a, R.styleable.StateListDrawable_visible); -- cgit v1.1