Skip to content

Commit 9f64867

Browse files
alanvAndroid (Google) Code Review
authored andcommitted
Merge "Fix theme propagation to contained android:drawable elements" into lmp-dev
2 parents 8f8bffa + 39e3362 commit 9f64867

9 files changed

Lines changed: 14 additions & 10 deletions

graphics/java/android/graphics/drawable/AnimatedRotateDrawable.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ public ConstantState getConstantState() {
257257
public void inflate(Resources r, XmlPullParser parser, AttributeSet attrs, Theme theme)
258258
throws XmlPullParserException, IOException {
259259

260-
final TypedArray a = r.obtainAttributes(attrs, R.styleable.AnimatedRotateDrawable);
260+
final TypedArray a = obtainAttributes(r, theme, attrs, R.styleable.AnimatedRotateDrawable);
261261

262262
super.inflateWithAttributes(r, parser, a, R.styleable.AnimatedRotateDrawable_visible);
263263

graphics/java/android/graphics/drawable/AnimatedStateListDrawable.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,8 @@ public void jumpToCurrentState() {
357357
public void inflate(@NonNull Resources r, @NonNull XmlPullParser parser,
358358
@NonNull AttributeSet attrs, @Nullable Theme theme)
359359
throws XmlPullParserException, IOException {
360-
final TypedArray a = r.obtainAttributes(attrs, R.styleable.AnimatedStateListDrawable);
360+
final TypedArray a = obtainAttributes(
361+
r, theme, attrs, R.styleable.AnimatedStateListDrawable);
361362

362363
super.inflateWithAttributes(r, parser, a, R.styleable.AnimatedStateListDrawable_visible);
363364

graphics/java/android/graphics/drawable/AnimationDrawable.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ private void setFrame(int frame, boolean unschedule, boolean animate) {
272272
public void inflate(Resources r, XmlPullParser parser, AttributeSet attrs, Theme theme)
273273
throws XmlPullParserException, IOException {
274274

275-
TypedArray a = r.obtainAttributes(attrs,
275+
TypedArray a = obtainAttributes(r, theme, attrs,
276276
com.android.internal.R.styleable.AnimationDrawable);
277277

278278
super.inflateWithAttributes(r, parser, a,
@@ -300,7 +300,8 @@ public void inflate(Resources r, XmlPullParser parser, AttributeSet attrs, Theme
300300
continue;
301301
}
302302

303-
a = r.obtainAttributes(attrs, com.android.internal.R.styleable.AnimationDrawableItem);
303+
a = obtainAttributes(
304+
r, theme, attrs, com.android.internal.R.styleable.AnimationDrawableItem);
304305
int duration = a.getInt(
305306
com.android.internal.R.styleable.AnimationDrawableItem_duration, -1);
306307
if (duration < 0) {

graphics/java/android/graphics/drawable/ClipDrawable.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ public void inflate(Resources r, XmlPullParser parser, AttributeSet attrs, Theme
8181

8282
int type;
8383

84-
TypedArray a = r.obtainAttributes(attrs, com.android.internal.R.styleable.ClipDrawable);
84+
TypedArray a = obtainAttributes(
85+
r, theme, attrs, com.android.internal.R.styleable.ClipDrawable);
8586

8687
int orientation = a.getInt(
8788
com.android.internal.R.styleable.ClipDrawable_clipOrientation,

graphics/java/android/graphics/drawable/InsetDrawable.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public InsetDrawable(Drawable drawable, int insetLeft, int insetTop,
8484
@Override
8585
public void inflate(Resources r, XmlPullParser parser, AttributeSet attrs, Theme theme)
8686
throws XmlPullParserException, IOException {
87-
final TypedArray a = r.obtainAttributes(attrs, R.styleable.InsetDrawable);
87+
final TypedArray a = obtainAttributes(r, theme, attrs, R.styleable.InsetDrawable);
8888
super.inflateWithAttributes(r, parser, a, R.styleable.InsetDrawable_visible);
8989

9090
mInsetState.mDrawable = null;

graphics/java/android/graphics/drawable/LevelListDrawable.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public void inflate(Resources r, XmlPullParser parser, AttributeSet attrs, Theme
105105
continue;
106106
}
107107

108-
TypedArray a = r.obtainAttributes(attrs,
108+
TypedArray a = obtainAttributes(r, theme, attrs,
109109
com.android.internal.R.styleable.LevelListDrawableItem);
110110

111111
low = a.getInt(

graphics/java/android/graphics/drawable/RotateDrawable.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ public ConstantState getConstantState() {
399399
@Override
400400
public void inflate(Resources r, XmlPullParser parser, AttributeSet attrs, Theme theme)
401401
throws XmlPullParserException, IOException {
402-
final TypedArray a = r.obtainAttributes(attrs,
402+
final TypedArray a = obtainAttributes(r, theme, attrs,
403403
com.android.internal.R.styleable.RotateDrawable);
404404

405405
super.inflateWithAttributes(r, parser, a,

graphics/java/android/graphics/drawable/ScaleDrawable.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ public void inflate(Resources r, XmlPullParser parser, AttributeSet attrs, Theme
9393

9494
int type;
9595

96-
TypedArray a = r.obtainAttributes(attrs, com.android.internal.R.styleable.ScaleDrawable);
96+
TypedArray a = obtainAttributes(
97+
r, theme, attrs, com.android.internal.R.styleable.ScaleDrawable);
9798

9899
float sw = getPercent(a, com.android.internal.R.styleable.ScaleDrawable_scaleWidth);
99100
float sh = getPercent(a, com.android.internal.R.styleable.ScaleDrawable_scaleHeight);

graphics/java/android/graphics/drawable/StateListDrawable.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ protected boolean onStateChange(int[] stateSet) {
118118
public void inflate(Resources r, XmlPullParser parser, AttributeSet attrs, Theme theme)
119119
throws XmlPullParserException, IOException {
120120

121-
final TypedArray a = r.obtainAttributes(attrs, R.styleable.StateListDrawable);
121+
final TypedArray a = obtainAttributes(r, theme, attrs, R.styleable.StateListDrawable);
122122

123123
super.inflateWithAttributes(r, parser, a,
124124
R.styleable.StateListDrawable_visible);

0 commit comments

Comments
 (0)