public final class ReflectiveDrawableLoader
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ICON_PREFIX_BASE |
static java.lang.String |
ICON_PREFIX_DIALOG |
static java.lang.String |
ICON_PREFIX_LAUNCHER |
static java.lang.String |
ICON_PREFIX_LIST |
static java.lang.String |
ICON_PREFIX_MENU |
static java.lang.String |
ICON_PREFIX_STATUS_BAR |
static java.lang.String |
ICON_PREFIX_TAB |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
formatKey(java.lang.String name,
java.lang.String family) |
static java.lang.String |
formatKey(java.lang.String prefix,
java.lang.String name,
java.lang.String family) |
int |
getDialogDrawable(java.lang.String drawableName,
java.lang.String family,
int fallbackDrawableId)
This is a convenience function which can be used to quickly fetch Dialog Drawables without
having to mess around with String concatenation in your code.
|
DrawableResourceContainer |
getDialogDrawableContainer(java.lang.String drawableName,
java.lang.String family,
java.lang.String colorString,
int fallbackDrawableId)
This is a convenience function which can be used to quickly fetch Dialog Drawables without
having to mess around with String concatenation in your code.
|
DrawableResourceContainer |
getDrawableContainer(java.lang.String drawableName,
java.lang.String colorString,
int fallbackDrawableId)
This function will return
DrawableResourceContainer containing the requested Drawable information
This function makes no assumptions regarding a Drawable's prefix, so you will need input its full name. |
DrawableResourceContainer |
getDrawableContainer(java.lang.String drawableName,
java.lang.String family,
java.lang.String colorString,
int fallbackDrawableId)
This function will return
DrawableResourceContainer containing the requested Drawable information
This function makes no assumptions regarding a Drawable's prefix, so you will need input its full name. |
int |
getDrawableId(java.lang.String drawableName,
int fallbackDrawableId)
Attempts to retrieve the Id of the requested Drawable.
|
int |
getDrawableId(java.lang.String drawableName,
java.lang.String family,
int fallbackDrawableId)
Attempts to retrieve the Id of the requested Drawable.
|
static ReflectiveDrawableLoader |
getInstance(Context context)
Returns an instance of the ReflectiveDrawableLoader
|
DrawableResourceContainer |
getLauncherDrawableContainer(java.lang.String drawableName,
java.lang.String family,
java.lang.String colorString,
int fallbackDrawableId)
This is a convenience function which can be used to quickly fetch Launcher Drawables without
having to mess around with String concatenation in your code.
|
int |
getLauncherDrawableId(java.lang.String drawableName,
java.lang.String family,
int fallbackDrawableId)
This is a convenience function which can be used to quickly fetch Launcher Drawables without
having to mess around with String concatenation in your code.
|
DrawableResourceContainer |
getListDrawableContainer(java.lang.String drawableName,
java.lang.String family,
java.lang.String colorString,
int fallbackDrawableId)
This is a convenience function which can be used to quickly fetch List Drawables without
having to mess around with String concatenation in your code.
|
int |
getListDrawableId(java.lang.String drawableName,
java.lang.String family,
int fallbackDrawableId)
This is a convenience function which can be used to quickly fetch List Drawables without
having to mess around with String concatenation in your code.
|
DrawableResourceContainer |
getMenuDrawableContainer(java.lang.String drawableName,
java.lang.String family,
java.lang.String colorString,
int fallbackDrawableId)
This is a convenience function which can be used to quickly fetch Menu Drawables without
having to mess around with String concatenation in your code.
|
int |
getMenuDrawableId(java.lang.String drawableName,
java.lang.String family,
int fallbackDrawableId)
This is a convenience function which can be used to quickly fetch Menu Drawables without
having to mess around with String concatenation in your code.
|
DrawableResourceContainer |
getStatusBarDrawableContainer(java.lang.String drawableName,
java.lang.String family,
java.lang.String colorString,
int fallbackDrawableId)
This is a convenience function which can be used to quickly fetch Status Bar Drawables without
having to mess around with String concatenation in your code.
|
int |
getStatusBarDrawableId(java.lang.String drawableName,
java.lang.String family,
int fallbackDrawableId)
This is a convenience function which can be used to quickly fetch Status Bar Drawables without
having to mess around with String concatenation in your code.
|
DrawableResourceContainer |
getTabDrawableContainer(java.lang.String drawableName,
java.lang.String family,
java.lang.String colorString,
int fallbackDrawableId)
This is a convenience function which can be used to quickly fetch Tab Drawables without
having to mess around with String concatenation in your code.
|
int |
getTabDrawableId(java.lang.String drawableName,
java.lang.String family,
int fallbackDrawableId)
This is a convenience function which can be used to quickly fetch Tab Drawables without
having to mess around with String concatenation in your code.
|
void |
printDrawablesToLogCat()
This function will print a list of all drawables this library can see into logcat
Only useful for debugging.
|
void |
setAddDrawableNameToContainer(boolean enable)
Enables or disables the addition of the requested Drawable name in the resulting
DrawableResourceContainer
when requesting a Colorised Drawable. |
void |
setLogErrors(boolean enable)
Enables or disables the logging of errors in LogCat during operation.
|
public static final java.lang.String ICON_PREFIX_BASE
public static final java.lang.String ICON_PREFIX_LAUNCHER
public static final java.lang.String ICON_PREFIX_MENU
public static final java.lang.String ICON_PREFIX_STATUS_BAR
public static final java.lang.String ICON_PREFIX_TAB
public static final java.lang.String ICON_PREFIX_DIALOG
public static final java.lang.String ICON_PREFIX_LIST
public int getDialogDrawable(java.lang.String drawableName, java.lang.String family, int fallbackDrawableId)
drawableName
- The name of the Drawable to fetch.family
- The family (if any) of the variable to fetch. Set to null if no family is needed.fallbackDrawableId
- The id of the Drawable to use if the requested one does not exist.public DrawableResourceContainer getDialogDrawableContainer(java.lang.String drawableName, java.lang.String family, java.lang.String colorString, int fallbackDrawableId)
drawableName
- The name of the Drawable to fetch.family
- The family (if any) of the variable to fetch. Set to null if no family is needed.colorString
- The colour used for the colour filter. It has to be in "#FFFFFF" format.fallbackDrawableId
- The id of the Drawable to use if the requested one does not exist.DrawableResourceContainer
with the requested Drawable data.public DrawableResourceContainer getDrawableContainer(java.lang.String drawableName, java.lang.String colorString, int fallbackDrawableId)
DrawableResourceContainer
containing the requested Drawable information
This function makes no assumptions regarding a Drawable's prefix, so you will need input its full name.
It is functionally identical to calling getDrawableContainer(drawableName, family, colorString, fallbackDrawableId)
with the family set to null.drawableName
- The name of the Drawable to fetch.colorString
- The colour used for the colour filter. It has to be in "#FFFFFF" format.fallbackDrawableId
- The id of the Drawable to use if the requested one does not exist.DrawableResourceContainer
with the requested Drawable data.public DrawableResourceContainer getDrawableContainer(java.lang.String drawableName, java.lang.String family, java.lang.String colorString, int fallbackDrawableId)
DrawableResourceContainer
containing the requested Drawable information
This function makes no assumptions regarding a Drawable's prefix, so you will need input its full name.drawableName
- The name of the Drawable to fetch.family
- The family (if any) of the variable to fetch. Set to null if no family is needed.colorString
- The colour used for the colour filter. It has to be in "#FFFFFF" format.fallbackDrawableId
- The id of the Drawable to use if the requested one does not exist.DrawableResourceContainer
with the requested Drawable data.public int getDrawableId(java.lang.String drawableName, int fallbackDrawableId)
drawableName
- The name of the Drawable to fetch.fallbackDrawableId
- The id of the Drawable to use if the requested one does not exist.public int getDrawableId(java.lang.String drawableName, java.lang.String family, int fallbackDrawableId)
drawableName
- The name of the Drawable to fetch.family
- The family (if any) of the variable to fetch. Set to null if no family is needed.fallbackDrawableId
- The id of the Drawable to use if the requested one does not exist.public DrawableResourceContainer getLauncherDrawableContainer(java.lang.String drawableName, java.lang.String family, java.lang.String colorString, int fallbackDrawableId)
drawableName
- The name of the Drawable to fetch.family
- The family (if any) of the variable to fetch. Set to null if no family is needed.colorString
- The colour used for the colour filter. It has to be in "#FFFFFF" format.fallbackDrawableId
- The id of the Drawable to use if the requested one does not exist.DrawableResourceContainer
with the requested Drawable data.public int getLauncherDrawableId(java.lang.String drawableName, java.lang.String family, int fallbackDrawableId)
drawableName
- The name of the Drawable to fetch.family
- The family (if any) of the variable to fetch. Set to null if no family is needed.fallbackDrawableId
- The id of the Drawable to use if the requested one does not exist.public DrawableResourceContainer getListDrawableContainer(java.lang.String drawableName, java.lang.String family, java.lang.String colorString, int fallbackDrawableId)
drawableName
- The name of the Drawable to fetch.family
- The family (if any) of the variable to fetch. Set to null if no family is needed.colorString
- The colour used for the colour filter. It has to be in "#FFFFFF" format.fallbackDrawableId
- The id of the Drawable to use if the requested one does not exist.DrawableResourceContainer
with the requested Drawable data.public int getListDrawableId(java.lang.String drawableName, java.lang.String family, int fallbackDrawableId)
drawableName
- The name of the Drawable to fetch.family
- The family (if any) of the variable to fetch. Set to null if no family is needed.fallbackDrawableId
- The id of the Drawable to use if the requested one does not exist.public DrawableResourceContainer getMenuDrawableContainer(java.lang.String drawableName, java.lang.String family, java.lang.String colorString, int fallbackDrawableId)
drawableName
- The name of the Drawable to fetch.family
- The family (if any) of the variable to fetch. Set to null if no family is needed.colorString
- The colour used for the colour filter. It has to be in "#FFFFFF" format.fallbackDrawableId
- The id of the Drawable to use if the requested one does not exist.DrawableResourceContainer
with the requested Drawable data.public int getMenuDrawableId(java.lang.String drawableName, java.lang.String family, int fallbackDrawableId)
drawableName
- The name of the Drawable to fetch.family
- The family (if any) of the variable to fetch. Set to null if no family is needed.fallbackDrawableId
- The id of the Drawable to use if the requested one does not exist.public DrawableResourceContainer getStatusBarDrawableContainer(java.lang.String drawableName, java.lang.String family, java.lang.String colorString, int fallbackDrawableId)
drawableName
- The name of the Drawable to fetch.family
- The family (if any) of the variable to fetch. Set to null if no family is needed.colorString
- The colour used for the colour filter. It has to be in "#FFFFFF" format.fallbackDrawableId
- The id of the Drawable to use if the requested one does not exist.DrawableResourceContainer
with the requested Drawable data.public int getStatusBarDrawableId(java.lang.String drawableName, java.lang.String family, int fallbackDrawableId)
drawableName
- The name of the Drawable to fetch.family
- The family (if any) of the variable to fetch. Set to null if no family is needed.fallbackDrawableId
- The id of the Drawable to use if the requested one does not exist.public DrawableResourceContainer getTabDrawableContainer(java.lang.String drawableName, java.lang.String family, java.lang.String colorString, int fallbackDrawableId)
drawableName
- The name of the Drawable to fetch.family
- The family (if any) of the variable to fetch. Set to null if no family is needed.colorString
- The colour used for the colour filter. It has to be in "#FFFFFF" format.fallbackDrawableId
- The id of the Drawable to use if the requested one does not exist.DrawableResourceContainer
with the requested Drawable data.public int getTabDrawableId(java.lang.String drawableName, java.lang.String family, int fallbackDrawableId)
drawableName
- The name of the Drawable to fetch.family
- The family (if any) of the variable to fetch. Set to null if no family is needed.fallbackDrawableId
- The id of the Drawable to use if the requested one does not exist.public void printDrawablesToLogCat()
public void setAddDrawableNameToContainer(boolean enable)
DrawableResourceContainer
when requesting a Colorised Drawable.enable
- - True to enable, false to disable. False by default;public void setLogErrors(boolean enable)
enable
- - True to enable, false to disable. False by default;public static java.lang.String formatKey(java.lang.String name, java.lang.String family)
public static java.lang.String formatKey(java.lang.String prefix, java.lang.String name, java.lang.String family)
public static ReflectiveDrawableLoader getInstance(Context context)
context
- A standard Android context. It cannot be null