public final class AppCompatResources extends Object
Modifier and Type | Method and Description |
---|---|
static ColorStateList |
getColorStateList(Context context,
int resId)
Returns the
ColorStateList from the given resource. |
static Drawable |
getDrawable(Context context,
int resId)
Return a drawable object associated with a particular resource ID.
|
public static ColorStateList getColorStateList(@NonNull Context context, @ColorRes int resId)
ColorStateList
from the given resource. The resource can include
themeable attributes, regardless of API level.context
- context to inflate againstresId
- the resource identifier of the ColorStateList to retrieve@Nullable public static Drawable getDrawable(@NonNull Context context, @DrawableRes int resId)
This method supports inflation of <vector>
and <animated-vector>
resources on devices where platform support is not available.
context
- context to inflate againstresId
- The desired resource identifier, as generated by the aapt
tool. This integer encodes the package, type, and resource
entry. The value 0 is an invalid identifier.ContextCompat.getDrawable(Context, int)