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

@@ -40,10 +40,12 @@ public class BitmapDrawable extends Drawable {
public void inflate(Resources r, XmlPullParser parser, AttributeSet attrs, Theme theme)
throws XmlPullParserException, IOException {
final TypedArray a = r.obtainAttributes(attrs, R.styleable.BitmapDrawable);
final TypedArray a = obtainAttributes(r, theme, attrs, R.styleable.BitmapDrawable);
if (a.hasValue(R.styleable.BitmapDrawable_src)) {
try {
bitmap = ((BitmapDrawable)a.getDrawable(R.styleable.BitmapDrawable_src)).bitmap;
paintable = bitmap.getTexture();
} catch (java.lang.Exception e) {e.printStackTrace();}
}
a.recycle();
}