Search in sources :

Example 1 with DrawableRes

use of androidx.annotation.DrawableRes in project AntennaPod by AntennaPod.

the class ThemeUtils method getDrawableFromAttr.

@DrawableRes
public static int getDrawableFromAttr(Context context, @AttrRes int attr) {
    TypedValue typedValue = new TypedValue();
    context.getTheme().resolveAttribute(attr, typedValue, true);
    return typedValue.resourceId;
}
Also used : TypedValue(android.util.TypedValue) DrawableRes(androidx.annotation.DrawableRes)

Aggregations

TypedValue (android.util.TypedValue)1 DrawableRes (androidx.annotation.DrawableRes)1