public final class ThemeUtil
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static boolean |
getBoolean(android.content.Context context,
int resourceId)
Obtains the boolean value, which corresponds to a specific resource id, from a context's
theme.
|
static boolean |
getBoolean(android.content.Context context,
int themeResourceId,
int resourceId)
Obtains the boolean value, which corresponds to a specific resource id, from a specific
theme.
|
static int |
getColor(android.content.Context context,
int resourceId)
Obtains the color, which corresponds to a specific resource id, from a context's theme.
|
static int |
getColor(android.content.Context context,
int themeResourceId,
int resourceId)
Obtains the color, which corresponds to a specific resource id, from a specific theme.
|
static android.content.res.ColorStateList |
getColorStateList(android.content.Context context,
int resourceId)
Obtains the color state list, which corresponds to a specific resource id, from a context's
theme.
|
static android.content.res.ColorStateList |
getColorStateList(android.content.Context context,
int themeResourceId,
int resourceId)
Obtains the color state list, which corresponds to a specific resource id, from a specific
theme.
|
static float |
getDimension(android.content.Context context,
int resourceId)
Obtains the dimension, which corresponds to a specific resource id, from a context's theme.
|
static float |
getDimension(android.content.Context context,
int themeResourceId,
int resourceId)
Obtains the dimension, which corresponds to a specific resource id, from a specific theme.
|
static int |
getDimensionPixelOffset(android.content.Context context,
int resourceId)
Obtains the dimension pixel offset, which corresponds to a specific resource id, from a
context's theme.
|
static int |
getDimensionPixelOffset(android.content.Context context,
int themeResourceId,
int resourceId)
Obtains the dimension pixel offset, which corresponds to a specific resource id, from a
specific theme.
|
static int |
getDimensionPixelSize(android.content.Context context,
int resourceId)
Obtains the dimension pixel size, which corresponds to a specific resource id, from a
context's theme.
|
static int |
getDimensionPixelSize(android.content.Context context,
int themeResourceId,
int resourceId)
Obtains the dimension pixel size, which corresponds to a specific resource id, from a
specific theme.
|
static android.graphics.drawable.Drawable |
getDrawable(android.content.Context context,
int resourceId)
Obtains the drawable, which corresponds to a specific resource id, from a context's theme.
|
static android.graphics.drawable.Drawable |
getDrawable(android.content.Context context,
int themeResourceId,
int resourceId)
Obtains the drawable, which corresponds to a specific resource id, from a specific theme.
|
static float |
getFloat(android.content.Context context,
int resourceId)
Obtains the float value, which corresponds to a specific resource id, from a context's
theme.
|
static float |
getFloat(android.content.Context context,
int themeResourceId,
int resourceId)
Obtains the float value, which corresponds to a specific resource id, from a specific theme.
|
static float |
getFraction(android.content.Context context,
int resourceId,
int base,
int pbase)
Obtains the fraction, which corresponds to a specific resource id, from a context's theme.
|
static float |
getFraction(android.content.Context context,
int themeResourceId,
int resourceId,
int base,
int pbase)
Obtains the fraction, which corresponds to a specific resource id, from a specific theme.
|
static int |
getInteger(android.content.Context context,
int resourceId)
Obtains the integer value, which corresponds to a specific resource id, from a context's
theme.
|
static int |
getInteger(android.content.Context context,
int themeResourceId,
int resourceId)
Obtains the integer value, which corresponds to a specific resource id, from a specific
theme.
|
static java.lang.String |
getString(android.content.Context context,
int resourceId)
Obtains the string, which corresponds to a specific resource id, from a context's theme.
|
static java.lang.String |
getString(android.content.Context context,
int themeResourceId,
int resourceId)
Obtains the string, which corresponds to a specific resource id, from a specific theme.
|
static java.lang.CharSequence |
getText(android.content.Context context,
int resourceId)
Obtains the text, which corresponds to a specific resource id, from a context's theme.
|
static java.lang.CharSequence |
getText(android.content.Context context,
int themeResourceId,
int resourceId)
Obtains the text, which corresponds to a specific resource id, from a specific theme.
|
static java.lang.CharSequence[] |
getTextArray(android.content.Context context,
int resourceId)
Obtains the text array, which corresponds to a specific resource id, from a context's theme.
|
static java.lang.CharSequence[] |
getTextArray(android.content.Context context,
int themeResourceId,
int resourceId)
Obtains the text array, which corresponds to a specific resource id, from a specific theme.
|
public static int getColor(android.content.Context context,
int resourceId)
Resources.NotFoundException will be thrown.context - The context, which should be used, as an instance of the class Context. The
context may not be nullresourceId - The resource id of the attribute, which should be obtained, as an Integer
value. The resource id must corresponds to a valid theme attributeInteger valuepublic static int getColor(android.content.Context context,
int themeResourceId,
int resourceId)
Resources.NotFoundException will be thrown.context - The context, which should be used, as an instance of the class Context. The
context may not be nullthemeResourceId - The resource id of the theme, the attribute should be obtained from, as an Integer value or -1, if the attribute should be obtained from the given context's
themeresourceId - The resource id of the attribute, which should be obtained, as an Integer
value. The resource id must corresponds to a valid theme attributeInteger valuepublic static android.content.res.ColorStateList getColorStateList(android.content.Context context,
int resourceId)
Resources.NotFoundException will be thrown.context - The context, which should be used, as an instance of the class Context. The
context may not be nullresourceId - The resource id of the attribute, which should be obtained, as an Integer
value. The resource id must corresponds to a valid theme attributeColorStateListpublic static android.content.res.ColorStateList getColorStateList(android.content.Context context,
int themeResourceId,
int resourceId)
Resources.NotFoundException will be thrown.context - The context, which should be used, as an instance of the class Context. The
context may not be nullthemeResourceId - The resource id of the theme, the attribute should be obtained from, as an Integer value or -1, if the attribute should be obtained from the given context's
themeresourceId - The resource id of the attribute, which should be obtained, as an Integer
value. The resource id must corresponds to a valid theme attributeColorStateListpublic static java.lang.String getString(android.content.Context context,
int resourceId)
Resources.NotFoundException will be thrown.context - The context, which should be used, as an instance of the class Context. The
context may not be nullresourceId - The resource id of the attribute, which should be obtained, as an Integer
value. The resource id must corresponds to a valid theme attributeStringpublic static java.lang.String getString(android.content.Context context,
int themeResourceId,
int resourceId)
Resources.NotFoundException will be thrown.context - The context, which should be used, as an instance of the class Context. The
context may not be nullthemeResourceId - The resource id of the theme, the attribute should be obtained from, as an Integer value or -1, if the attribute should be obtained from the given context's
themeresourceId - The resource id of the attribute, which should be obtained, as an Integer
value. The resource id must corresponds to a valid theme attributeStringpublic static java.lang.CharSequence getText(android.content.Context context,
int resourceId)
Resources.NotFoundException will be thrown.context - The context, which should be used, as an instance of the class Context. The
context may not be nullresourceId - The resource id of the attribute, which should be obtained, as an Integer
value. The resource id must corresponds to a valid theme attributeCharSequencepublic static java.lang.CharSequence getText(android.content.Context context,
int themeResourceId,
int resourceId)
Resources.NotFoundException will be thrown.context - The context, which should be used, as an instance of the class Context. The
context may not be nullthemeResourceId - The resource id of the theme, the attribute should be obtained from, as an Integer value or -1, if the attribute should be obtained from the given context's
themeresourceId - The resource id of the attribute, which should be obtained, as an Integer
value. The resource id must corresponds to a valid theme attributeCharSequencepublic static java.lang.CharSequence[] getTextArray(android.content.Context context,
int resourceId)
Resources.NotFoundException will be thrown.context - The context, which should be used, as an instance of the class Context. The
context may not be nullresourceId - The resource id of the attribute, which should be obtained, as an Integer
value. The resource id must corresponds to a valid theme attributeCharSequencepublic static java.lang.CharSequence[] getTextArray(android.content.Context context,
int themeResourceId,
int resourceId)
Resources.NotFoundException will be thrown.context - The context, which should be used, as an instance of the class Context. The
context may not be nullthemeResourceId - The resource id of the theme, the attribute should be obtained from, as an Integer value or -1, if the attribute should be obtained from the given context's
themeresourceId - The resource id of the attribute, which should be obtained, as an Integer
value. The resource id must corresponds to a valid theme attributeCharSequencepublic static float getDimension(android.content.Context context,
int resourceId)
Resources.NotFoundException will be thrown.context - The context, which should be used, as an instance of the class Context. The
context may not be nullresourceId - The resource id of the attribute, which should be obtained, as an Integer
value. The resource id must corresponds to a valid theme attributeFloat valuepublic static float getDimension(android.content.Context context,
int themeResourceId,
int resourceId)
Resources.NotFoundException will be thrown.context - The context, which should be used, as an instance of the class Context. The
context may not be nullthemeResourceId - The resource id of the theme, the attribute should be obtained from, as an Integer value or -1, if the attribute should be obtained from the given context's
themeresourceId - The resource id of the attribute, which should be obtained, as an Integer
value. The resource id must corresponds to a valid theme attributeFloat valuepublic static int getDimensionPixelSize(android.content.Context context,
int resourceId)
Resources.NotFoundException will be
thrown.context - The context, which should be used, as an instance of the class Context. The
context may not be nullresourceId - The resource id of the attribute, which should be obtained, as an Integer
value. The resource id must corresponds to a valid theme attributeInteger valuepublic static int getDimensionPixelSize(android.content.Context context,
int themeResourceId,
int resourceId)
Resources.NotFoundException will be
thrown.context - The context, which should be used, as an instance of the class Context. The
context may not be nullthemeResourceId - The resource id of the theme, the attribute should be obtained from, as an Integer value or -1, if the attribute should be obtained from the given context's
themeresourceId - The resource id of the attribute, which should be obtained, as an Integer
value. The resource id must corresponds to a valid theme attributeInteger valuepublic static int getDimensionPixelOffset(android.content.Context context,
int resourceId)
Resources.NotFoundException will be
thrown.context - The context, which should be used, as an instance of the class Context. The
context may not be nullresourceId - The resource id of the attribute, which should be obtained, as an Integer
value. The resource id must corresponds to a valid theme attributeInteger valuepublic static int getDimensionPixelOffset(android.content.Context context,
int themeResourceId,
int resourceId)
Resources.NotFoundException will be
thrown.context - The context, which should be used, as an instance of the class Context. The
context may not be nullthemeResourceId - The resource id of the theme, the attribute should be obtained from, as an Integer value or -1, if the attribute should be obtained from the given context's
themeresourceId - The resource id of the attribute, which should be obtained, as an Integer
value. The resource id must corresponds to a valid theme attributeInteger valuepublic static android.graphics.drawable.Drawable getDrawable(android.content.Context context,
int resourceId)
Resources.NotFoundException will be thrown.context - The context, which should be used, as an instance of the class Context. The
context may not be nullresourceId - The resource id of the attribute, which should be obtained, as an Integer
value. The resource id must corresponds to a valid theme attributeDrawablepublic static android.graphics.drawable.Drawable getDrawable(android.content.Context context,
int themeResourceId,
int resourceId)
Resources.NotFoundException will be thrown.context - The context, which should be used, as an instance of the class Context. The
context may not be nullthemeResourceId - The resource id of the theme, the attribute should be obtained from, as an Integer value or -1, if the attribute should be obtained from the given context's
themeresourceId - The resource id of the attribute, which should be obtained, as an Integer
value. The resource id must corresponds to a valid theme attributeDrawablepublic static float getFraction(android.content.Context context,
int resourceId,
int base,
int pbase)
Resources.NotFoundException will be thrown.context - The context, which should be used, as an instance of the class Context. The
context may not be nullresourceId - The resource id of the attribute, which should be obtained, as an Integer
value. The resource id must corresponds to a valid theme attributebase - The base value of this fraction as an Integer value. A standard fraction is
multiplied by this valuepbase - The parent base value of this fraction as an Integer value. A parent fraction
(nn%p) is multiplied by this valueFloat valuepublic static float getFraction(android.content.Context context,
int themeResourceId,
int resourceId,
int base,
int pbase)
Resources.NotFoundException will be thrown.context - The context, which should be used, as an instance of the class Context. The
context may not be nullthemeResourceId - The resource id of the theme, the attribute should be obtained from, as an Integer value or -1, if the attribute should be obtained from the given context's
themeresourceId - The resource id of the attribute, which should be obtained, as an Integer
value. The resource id must corresponds to a valid theme attributebase - The base value of this fraction as an Integer value. A standard fraction is
multiplied by this valuepbase - The parent base value of this fraction as an Integer value. A parent fraction
(nn%p) is multiplied by this valueFloat valuepublic static boolean getBoolean(android.content.Context context,
int resourceId)
context - The context, which should be used, as an instance of the class Context. The
context may not be nullresourceId - The resource id of the attribute, which should be obtained, as an Integer
value. The resource id must corresponds to a valid theme attributeBoolean value or false, if
the given resource id is invalidpublic static boolean getBoolean(android.content.Context context,
int themeResourceId,
int resourceId)
context - The context, which should be used, as an instance of the class Context. The
context may not be nullthemeResourceId - The resource id of the theme, the attribute should be obtained from, as an Integer value or -1, if the attribute should be obtained from the given context's
themeresourceId - The resource id of the attribute, which should be obtained, as an Integer
value. The resource id must corresponds to a valid theme attributeBoolean value or false, if
the given resource id is invalidpublic static int getInteger(android.content.Context context,
int resourceId)
context - The context, which should be used, as an instance of the class Context. The
context may not be nullresourceId - The resource id of the attribute, which should be obtained, as an Integer
value. The resource id must corresponds to a valid theme attributeInteger value or 0, if the
given resource id is invalidpublic static int getInteger(android.content.Context context,
int themeResourceId,
int resourceId)
context - The context, which should be used, as an instance of the class Context. The
context may not be nullthemeResourceId - The resource id of the theme, the attribute should be obtained from, as an Integer value or -1, if the attribute should be obtained from the given context's
themeresourceId - The resource id of the attribute, which should be obtained, as an Integer
value. The resource id must corresponds to a valid theme attributeInteger value or 0, if the
given resource id is invalidpublic static float getFloat(android.content.Context context,
int resourceId)
context - The context, which should be used, as an instance of the class Context. The
context may not be nullresourceId - The resource id of the attribute, which should be obtained, as an Integer
value. The resource id must corresponds to a valid theme attributeFloat value or 0, if the given
resource id is invalidpublic static float getFloat(android.content.Context context,
int themeResourceId,
int resourceId)
context - The context, which should be used, as an instance of the class Context. The
context may not be nullthemeResourceId - The resource id of the theme, the attribute should be obtained from, as an Integer value or -1, if the attribute should be obtained from the given context's
themeresourceId - The resource id of the attribute, which should be obtained, as an Integer
value. The resource id must corresponds to a valid theme attributeFloat value or 0, if the given
resource id is invalid