Loading src/com/android/settings/widget/TintDrawable.java +11 −1 Original line number Diff line number Diff line Loading @@ -54,7 +54,7 @@ public class TintDrawable extends DrawableWrapper { public void inflate(@NonNull Resources r, @NonNull XmlPullParser parser, @NonNull AttributeSet attrs, @Nullable Theme theme) throws XmlPullParserException, IOException { final TypedArray a = obtainAttributes(r, theme, attrs, R.styleable.TintDrawable); final TypedArray a = obtainAttributes(r, theme, attrs); super.inflate(r, parser, attrs, theme); Loading Loading @@ -99,4 +99,14 @@ public class TintDrawable extends DrawableWrapper { getDrawable().mutate().setTintList(mTint); } } private static @NonNull TypedArray obtainAttributes(@NonNull Resources res, @Nullable Theme theme, @NonNull AttributeSet set) { // Don't depend on Drawable.obtainAttributes, which is @hide, thus cannot be accessed by // Settings search if (theme == null) { return res.obtainAttributes(set, R.styleable.TintDrawable); } return theme.obtainStyledAttributes(set, R.styleable.TintDrawable, 0, 0); } } Loading
src/com/android/settings/widget/TintDrawable.java +11 −1 Original line number Diff line number Diff line Loading @@ -54,7 +54,7 @@ public class TintDrawable extends DrawableWrapper { public void inflate(@NonNull Resources r, @NonNull XmlPullParser parser, @NonNull AttributeSet attrs, @Nullable Theme theme) throws XmlPullParserException, IOException { final TypedArray a = obtainAttributes(r, theme, attrs, R.styleable.TintDrawable); final TypedArray a = obtainAttributes(r, theme, attrs); super.inflate(r, parser, attrs, theme); Loading Loading @@ -99,4 +99,14 @@ public class TintDrawable extends DrawableWrapper { getDrawable().mutate().setTintList(mTint); } } private static @NonNull TypedArray obtainAttributes(@NonNull Resources res, @Nullable Theme theme, @NonNull AttributeSet set) { // Don't depend on Drawable.obtainAttributes, which is @hide, thus cannot be accessed by // Settings search if (theme == null) { return res.obtainAttributes(set, R.styleable.TintDrawable); } return theme.obtainStyledAttributes(set, R.styleable.TintDrawable, 0, 0); } }