public final class SettingsResourceUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static android.graphics.drawable.Drawable |
getDrawable(android.content.res.Resources resources,
int resId,
android.content.res.Resources.Theme theme)
Obtains drawable with the specified resId using the given resources.
|
static android.graphics.drawable.Drawable |
getVectorDrawable(android.content.res.Resources resources,
int resId,
android.content.res.Resources.Theme theme)
Obtains vector drawable with the specified resId using the given resources.
|
@Nullable
public static android.graphics.drawable.Drawable getVectorDrawable(@NonNull
android.content.res.Resources resources,
@DrawableRes
int resId,
@Nullable
android.content.res.Resources.Theme theme)
throws android.content.res.Resources.NotFoundException
This utility method will obtain the requested vector drawable in a way that is appropriate for the current Android version.
resources - The resources that should be used to obtain the vector drawable.resId - Resource id of the desired vector drawable to obtain.theme - Theme that will be used to resolve theme attributes for the requested drawable
on Build.VERSION_CODES#LOLLIPOP and above Android versions.null if the specified resource
id is 0.android.content.res.Resources.NotFoundExceptiongetDrawable(Resources, int, Resources.Theme),
VectorDrawableCompat.create(Resources, int, Resources.Theme)@Nullable
public static android.graphics.drawable.Drawable getDrawable(@NonNull
android.content.res.Resources resources,
@DrawableRes
int resId,
@Nullable
android.content.res.Resources.Theme theme)
throws android.content.res.Resources.NotFoundException
This utility method will obtain the requested drawable in a way that is appropriate for the current Android version.
resources - The resources that should be used to obtain the drawable.resId - Resource id of the desired drawable to obtain.theme - Theme that will be used to resolve theme attributes for the requested drawable
on Build.VERSION_CODES#LOLLIPOP and above Android versions.null if the specified resource id is 0.android.content.res.Resources.NotFoundExceptionResources.getDrawable(int, Resources.Theme),
Resources.getDrawable(int)