AppCompatResources
public final class AppCompatResources
Class for accessing an application's resources through AppCompat, and thus any backward compatible functionality.
Summary
Public methods |
|
|---|---|
static ColorStateList |
getColorStateList(@NonNull Context context, @ColorRes int resId)Returns the |
static @Nullable Drawable |
getDrawable(@NonNull Context context, @DrawableRes int resId)Return a drawable object associated with a particular resource ID. |
Public methods
getColorStateList
public static ColorStateList getColorStateList(@NonNull Context context, @ColorRes int resId)
Returns the ColorStateList from the given resource. The resource can include themeable attributes, regardless of API level.
getDrawable
public static @Nullable Drawable getDrawable(@NonNull Context context, @DrawableRes int resId)
Return a drawable object associated with a particular resource ID.
This method supports inflation of <vector>, <animated-vector> and <animated-selector> resources on devices where platform support is not available.
| Parameters | |
|---|---|
@NonNull Context context |
context to inflate against |
@DrawableRes int resId |
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. |
| See also | |
|---|---|
getDrawable |