Class DynamicHint.Config

java.lang.Object
com.pranavpandey.android.dynamic.toasts.DynamicHint.Config
Enclosing class:
DynamicHint

public static class DynamicHint.Config extends Object
Configuration class to customise the DynamicHint attributes.
  • Method Details

    • 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 Integer defaultBackgroundColor)
      Set the default background color.
      Parameters:
      defaultBackgroundColor - The background color to be set.
      Returns:
      The DynamicHint.Config object to allow for chaining of calls to set methods.
    • setDefaultTintColor

      @NonNull public DynamicHint.Config setDefaultTintColor(@Nullable @ColorInt Integer defaultTintColor)
      Set the default tint color.
      Parameters:
      defaultTintColor - The tint color to be set.
      Returns:
      The DynamicHint.Config object to allow for chaining of calls to set methods.
    • setErrorBackgroundColor

      @NonNull public DynamicHint.Config setErrorBackgroundColor(@Nullable @ColorInt Integer errorBackgroundColor)
      Set the error background color.
      Parameters:
      errorBackgroundColor - The error background color to be set.
      Returns:
      The DynamicHint.Config object to allow for chaining of calls to set methods.
    • setSuccessBackgroundColor

      @NonNull public DynamicHint.Config setSuccessBackgroundColor(@Nullable @ColorInt Integer successBackgroundColor)
      Set the success background color.
      Parameters:
      successBackgroundColor - The success background color to be set.
      Returns:
      The DynamicHint.Config object to allow for chaining of calls to set methods.
    • setWarningBackgroundColor

      @NonNull public DynamicHint.Config setWarningBackgroundColor(@Nullable @ColorInt Integer warningBackgroundColor)
      Set the warning background color.
      Parameters:
      warningBackgroundColor - The warning background color to be set.
      Returns:
      The DynamicHint.Config object to allow for chaining of calls to set methods.
    • setErrorIcon

      @NonNull public DynamicHint.Config setErrorIcon(@Nullable Drawable errorIcon)
      Set the error icon.

      Pass null to use the default icon.

      Parameters:
      errorIcon - The error icon to be set.
      Returns:
      The DynamicHint.Config object to allow for chaining of calls to set methods.
    • setSuccessIcon

      @NonNull public DynamicHint.Config setSuccessIcon(@Nullable Drawable successIcon)
      Set the success icon.

      Pass null to use the default icon.

      Parameters:
      successIcon - The success icon to be set.
      Returns:
      The DynamicHint.Config object to allow for chaining of calls to set methods.
    • setWarningIcon

      @NonNull public DynamicHint.Config setWarningIcon(@Nullable Drawable warningIcon)
      Set the warning icon.

      Pass null to use the default icon.

      Parameters:
      warningIcon - The warning icon to be set.
      Returns:
      The DynamicHint.Config object to allow for chaining of calls to set methods.
    • setDisableIcon

      @NonNull public DynamicHint.Config setDisableIcon(boolean disableIcon)
      Set the icon visibility.
      Parameters:
      disableIcon - true to disable icon for all the toasts.
      Returns:
      The DynamicHint.Config object 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 - true to tint icon for all the toasts.
      Returns:
      The DynamicHint.Config object 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 in pixels.
      Returns:
      The DynamicHint.Config object 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 in sp.
      Returns:
      The DynamicHint.Config object to allow for chaining of calls to set methods.
    • setTextTypeface

      @NonNull public DynamicHint.Config setTextTypeface(@Nullable Typeface textTypeface)
      Set the text typeface.

      Pass null to use the default typeface.

      Parameters:
      textTypeface - The text typeface to be set.
      Returns:
      The DynamicHint.Config object to allow for chaining of calls to set methods.
    • setToastBackground

      @NonNull public DynamicHint.Config setToastBackground(@Nullable Drawable toastBackground)
      Set the toast background.

      Pass null to use the default background.

      Parameters:
      toastBackground - The toast background to be set.
      Returns:
      The DynamicHint.Config object to allow for chaining of calls to set methods.
    • apply

      public void apply()
      Apply customisations.
    • reset

      public void reset()
      Reset customisations.