Class DynamicHint.Config

  • Enclosing class:
    DynamicHint

    public static class DynamicHint.Config
    extends java.lang.Object
    Configuration class to customise the DynamicHint attributes.
    • 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.Config object 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.Config object 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.Config object 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.Config object 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.Config object 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 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
                                                 android.graphics.drawable.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
                                                 android.graphics.drawable.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
                                                  android.graphics.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
                                                     android.graphics.drawable.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.