public final class ThemeUtil
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static int |
getColor(android.content.Context context,
int colorAttribute)
Returns a color value specified by the given theme attribute.
|
static android.graphics.drawable.Drawable |
getDrawable(android.content.Context context,
android.content.res.TypedArray typedArray,
int index)
Gets a
Drawable from TypedArray and index of attribute. |
static java.lang.String |
getString(android.content.res.TypedArray typedArray,
int index)
Gets a string from
TypedArray and index of attribute. |
static int |
getStyleId(android.content.Context context,
int themeAttribute)
Returns a resource id for the given theme attribute.
|
public static android.graphics.drawable.Drawable getDrawable(android.content.Context context,
android.content.res.TypedArray typedArray,
int index)
Drawable from TypedArray and index of attribute.context - the required context.typedArray - the array of values.index - the index of the attribute.Drawable or null if a raw TypedValue could not be retrieved.java.lang.IllegalArgumentException - if the attribute at index cannot be resolved.public static java.lang.String getString(android.content.res.TypedArray typedArray,
int index)
TypedArray and index of attribute.typedArray - the array of values.index - the index of the attribute.public static int getColor(android.content.Context context,
int colorAttribute)
context - the required context.colorAttribute - a theme attribute such as R.attr.colorBackground.Color.CYAN is returned.public static int getStyleId(android.content.Context context,
int themeAttribute)
context - the required context.themeAttribute - a theme attribute whose value is an arbitrary resource id.