Class DynamicHint.Config
- java.lang.Object
-
- com.pranavpandey.android.dynamic.toasts.DynamicHint.Config
-
- Enclosing class:
- DynamicHint
public static class DynamicHint.Config extends java.lang.ObjectConfiguration class to customise theDynamicHintattributes.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapply()Apply customisations.static DynamicHint.ConfiggetInstance()Get instance to access public methods.voidreset()Reset customisations.DynamicHint.ConfigsetDefaultBackgroundColor(java.lang.Integer defaultBackgroundColor)Set the default background color.DynamicHint.ConfigsetDefaultTintColor(java.lang.Integer defaultTintColor)Set the default tint color.DynamicHint.ConfigsetDisableIcon(boolean disableIcon)Set the icon visibility.DynamicHint.ConfigsetErrorBackgroundColor(java.lang.Integer errorBackgroundColor)Set the error background color.DynamicHint.ConfigsetErrorIcon(android.graphics.drawable.Drawable errorIcon)Set the error icon.DynamicHint.ConfigsetIconSize(int iconSize)Set the icon size.DynamicHint.ConfigsetSuccessBackgroundColor(java.lang.Integer successBackgroundColor)Set the success background color.DynamicHint.ConfigsetSuccessIcon(android.graphics.drawable.Drawable successIcon)Set the success icon.DynamicHint.ConfigsetTextSize(int textSize)Set the text size.DynamicHint.ConfigsetTextTypeface(android.graphics.Typeface textTypeface)Set the text typeface.DynamicHint.ConfigsetTintIcon(boolean tintIcon)Set whether to tint the icon.DynamicHint.ConfigsetToastBackground(android.graphics.drawable.Drawable toastBackground)Set the toast background.DynamicHint.ConfigsetWarningBackgroundColor(java.lang.Integer warningBackgroundColor)Set the warning background color.DynamicHint.ConfigsetWarningIcon(android.graphics.drawable.Drawable warningIcon)Set the warning icon.
-
-
-
Method Detail
-
getInstance
@NonNull public static DynamicHint.Config getInstance()
Get instance to access public methods. Must be called before accessing methods.- Returns:
- The singleton instance of this class.
-
setDefaultBackgroundColor
@NonNull public DynamicHint.Config setDefaultBackgroundColor(@Nullable @ColorInt java.lang.Integer defaultBackgroundColor)
Set the default background color.- Parameters:
defaultBackgroundColor- The background color to be set.- Returns:
- The
DynamicHint.Configobject to allow for chaining of calls to set methods.
-
setDefaultTintColor
@NonNull public DynamicHint.Config setDefaultTintColor(@Nullable @ColorInt java.lang.Integer defaultTintColor)
Set the default tint color.- Parameters:
defaultTintColor- The tint color to be set.- Returns:
- The
DynamicHint.Configobject to allow for chaining of calls to set methods.
-
setErrorBackgroundColor
@NonNull public DynamicHint.Config setErrorBackgroundColor(@Nullable @ColorInt java.lang.Integer errorBackgroundColor)
Set the error background color.- Parameters:
errorBackgroundColor- The error background color to be set.- Returns:
- The
DynamicHint.Configobject to allow for chaining of calls to set methods.
-
setSuccessBackgroundColor
@NonNull public DynamicHint.Config setSuccessBackgroundColor(@Nullable @ColorInt java.lang.Integer successBackgroundColor)
Set the success background color.- Parameters:
successBackgroundColor- The success background color to be set.- Returns:
- The
DynamicHint.Configobject to allow for chaining of calls to set methods.
-
setWarningBackgroundColor
@NonNull public DynamicHint.Config setWarningBackgroundColor(@Nullable @ColorInt java.lang.Integer warningBackgroundColor)
Set the warning background color.- Parameters:
warningBackgroundColor- The warning background color to be set.- Returns:
- The
DynamicHint.Configobject to allow for chaining of calls to set methods.
-
setErrorIcon
@NonNull public DynamicHint.Config setErrorIcon(@Nullable android.graphics.drawable.Drawable errorIcon)
Set the error icon.Pass
nullto use the default icon.- Parameters:
errorIcon- The error icon to be set.- Returns:
- The
DynamicHint.Configobject to allow for chaining of calls to set methods.
-
setSuccessIcon
@NonNull public DynamicHint.Config setSuccessIcon(@Nullable android.graphics.drawable.Drawable successIcon)
Set the success icon.Pass
nullto use the default icon.- Parameters:
successIcon- The success icon to be set.- Returns:
- The
DynamicHint.Configobject to allow for chaining of calls to set methods.
-
setWarningIcon
@NonNull public DynamicHint.Config setWarningIcon(@Nullable android.graphics.drawable.Drawable warningIcon)
Set the warning icon.Pass
nullto use the default icon.- Parameters:
warningIcon- The warning icon to be set.- Returns:
- The
DynamicHint.Configobject to allow for chaining of calls to set methods.
-
setDisableIcon
@NonNull public DynamicHint.Config setDisableIcon(boolean disableIcon)
Set the icon visibility.- Parameters:
disableIcon-trueto disable icon for all the toasts.- Returns:
- The
DynamicHint.Configobject to allow for chaining of calls to set methods.
-
setTintIcon
@NonNull public DynamicHint.Config setTintIcon(boolean tintIcon)
Set whether to tint the icon.- Parameters:
tintIcon-trueto tint icon for all the toasts.- Returns:
- The
DynamicHint.Configobject to allow for chaining of calls to set methods.
-
setIconSize
@NonNull public DynamicHint.Config setIconSize(int iconSize)
Set the icon size.- Parameters:
iconSize- The icon size to be set inpixels.- Returns:
- The
DynamicHint.Configobject to allow for chaining of calls to set methods.
-
setTextSize
@NonNull public DynamicHint.Config setTextSize(int textSize)
Set the text size.- Parameters:
textSize- The text size to be set insp.- Returns:
- The
DynamicHint.Configobject to allow for chaining of calls to set methods.
-
setTextTypeface
@NonNull public DynamicHint.Config setTextTypeface(@Nullable android.graphics.Typeface textTypeface)
Set the text typeface.Pass
nullto use the default typeface.- Parameters:
textTypeface- The text typeface to be set.- Returns:
- The
DynamicHint.Configobject to allow for chaining of calls to set methods.
-
setToastBackground
@NonNull public DynamicHint.Config setToastBackground(@Nullable android.graphics.drawable.Drawable toastBackground)
Set the toast background.Pass
nullto use the default background.- Parameters:
toastBackground- The toast background to be set.- Returns:
- The
DynamicHint.Configobject to allow for chaining of calls to set methods.
-
apply
public void apply()
Apply customisations.
-
reset
public void reset()
Reset customisations.
-
-