public final class ThemeUtil
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static boolean |
getBoolean(android.content.Context context,
int resourceId)
Deprecated.
Use method
getBoolean(Context, int, boolean) instead |
static boolean |
getBoolean(android.content.Context context,
int resourceId,
boolean defaultValue)
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)
Deprecated.
Use method
getBoolean(Context, int, int, boolean) instead |
static boolean |
getBoolean(android.content.Context context,
int themeResourceId,
int resourceId,
boolean defaultValue)
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)
Deprecated.
Use the method
getFloat(Context, int, float) instead |
static float |
getFloat(android.content.Context context,
int resourceId,
float defaultValue)
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)
Deprecated.
Use the method
getFloat(Context, int, int, float) instead |
static float |
getFloat(android.content.Context context,
int themeResourceId,
int resourceId,
float defaultValue)
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 |
getInt(android.content.Context context,
int resourceId,
int defaultValue)
Obtains the integer value, which corresponds to a specific resource id, from a context's
theme.
|
static int |
getInt(android.content.Context context,
int themeResourceId,
int resourceId,
int defaultValue)
Obtains the integer value, which corresponds to a specific resource id, from a specific
theme.
|
static int |
getInteger(android.content.Context context,
int resourceId)
Deprecated.
Use method
getInt(Context, int, int) instead |
static int |
getInteger(android.content.Context context,
int themeResourceId,
int resourceId)
Deprecated.
Use method
getInt(Context, int, int, int) instead |
static int |
getResId(android.content.Context context,
int resourceId,
int defaultValue)
Obtains the resource id, which corresponds to a specific resource id, from a context's
theme.
|
static int |
getResId(android.content.Context context,
int themeResourceId,
int resourceId,
int defaultValue)
Obtains the resource id, which corresponds to a specific resource id, from a specific theme.
|
static int |
getResourceId(android.content.Context context,
int resourceId)
Deprecated.
Use the method
getResId(Context, int, int) instead |
static int |
getResourceId(android.content.Context context,
int themeResourceId,
int resourceId)
Deprecated.
Use the method
getResId(Context, int, int, int) instead |
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 value@Deprecated
public static boolean getBoolean(android.content.Context context,
int resourceId)
getBoolean(Context, int, boolean) insteadcontext - 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)
getBoolean(Context, int, int, boolean) insteadcontext - 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 boolean getBoolean(android.content.Context context,
int resourceId,
boolean defaultValue)
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 attributedefaultValue - The default value, which should be returned, if the given resource id is invalid, as
a Boolean valueBoolean value or false, if
the given resource id is invalidpublic static boolean getBoolean(android.content.Context context,
int themeResourceId,
int resourceId,
boolean defaultValue)
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 attributedefaultValue - The default value, which should be returned, if the given resource id is invalid, as
a Boolean valueBoolean value or false, if
the given resource id is invalid@Deprecated
public static int getInteger(android.content.Context context,
int resourceId)
getInt(Context, int, int) insteadcontext - 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 invalid@Deprecated
public static int getInteger(android.content.Context context,
int themeResourceId,
int resourceId)
getInt(Context, int, int, int) insteadcontext - 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 int getInt(android.content.Context context,
int resourceId,
int defaultValue)
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 attributedefaultValue - The default value, which should be returned, if the given resource id is invalid, as
an Integer valueInteger value or 0, if the
given resource id is invalidpublic static int getInt(android.content.Context context,
int themeResourceId,
int resourceId,
int defaultValue)
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 attributedefaultValue - The default value, which should be returned, if the given resource id is invalid, as
an Integer valueInteger value or 0, if the
given resource id is invalid@Deprecated
public static float getFloat(android.content.Context context,
int resourceId)
getFloat(Context, int, float) insteadcontext - 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 invalid@Deprecated
public static float getFloat(android.content.Context context,
int themeResourceId,
int resourceId)
getFloat(Context, int, int, float) insteadcontext - 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 invalidpublic static float getFloat(android.content.Context context,
int resourceId,
float defaultValue)
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 attributedefaultValue - The default value, which should be returned, if the given resource id is invalid, as
a Float valueFloat value or 0, if the given
resource id is invalidpublic static float getFloat(android.content.Context context,
int themeResourceId,
int resourceId,
float defaultValue)
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 attributedefaultValue - The default value, which should be returned, if the given resource id is invalid, as
a Float valueFloat value or 0, if the given
resource id is invalid@Deprecated
public static int getResourceId(android.content.Context context,
int resourceId)
getResId(Context, int, int) insteadcontext - 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 invalid@Deprecated
public static int getResourceId(android.content.Context context,
int themeResourceId,
int resourceId)
getResId(Context, int, int, int) insteadcontext - 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 correspond to a valid theme attributeInteger value or 0, if the
given resource id is invalidpublic static int getResId(android.content.Context context,
int resourceId,
int defaultValue)
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 attributedefaultValue - The default value, which should be returned, if the given resource id is invalid, as
an Integer valueInteger value or 0, if the
given resource id is invalidpublic static int getResId(android.content.Context context,
int themeResourceId,
int resourceId,
int defaultValue)
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 correspond to a valid theme attributedefaultValue - The default value, which should be returned, if the given resource id is invalid, as
an Integer valueInteger value or 0, if the
given resource id is invalid