Drawable: fix theme not getting passed to newly inflated drawables

When Theme support was added, not everything was immediately updated
to use theme information properly. This was fixed in a lot of places
since then, but it seems not here.
This commit is contained in:
Mis012
2025-02-27 01:08:54 +01:00
parent 8afb1a0fe2
commit ca39c81224
6 changed files with 39 additions and 23 deletions

View File

@@ -234,7 +234,7 @@ public class AnimationDrawable extends DrawableContainer implements Runnable, An
/* public void inflate(Resources r, XmlPullParser parser, AttributeSet attrs)
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,
@@ -262,7 +262,7 @@ 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) {
@@ -287,7 +287,7 @@ public class AnimationDrawable extends DrawableContainer implements Runnable, An
+
" defining a drawable");
}
dr = Drawable.createFromXmlInner(r, parser, attrs);
dr = Drawable.createFromXmlInner(r, parser, attrs, theme);
}
mAnimationState.addFrame(dr, duration);