Class DefaultToastOptions

  • All Implemented Interfaces:
    IsDefaultToastOptions

    public final class DefaultToastOptions
    extends AbstractNode
    Provides the defaults of the toast options.
    Author:
    Andrea "Stock" Stocchero
    • Method Detail

      • setType

        public final void setType​(IsToastType type)
        Sets the type of the toast.
        Parameters:
        type - the type of the toast
      • setProgressBarType

        public final void setProgressBarType​(IsProgressBarType type)
        Sets the type of the toast progress bar.
        Parameters:
        type - the type of the toast progress bar
      • setProgressBarHeight

        public final void setProgressBarHeight​(int height)
        Sets the height (in pixels) of the toast progress bar.
        Parameters:
        height - the height (in pixels) of the toast progress bar
      • setHideProgressBar

        public final void setHideProgressBar​(boolean hide)
        Sets true whether to hide the progress bar.
        Parameters:
        hide - true whether to hide the progress bar
      • setHideShadow

        public final void setHideShadow​(boolean hide)
        Sets true whether to hide the shadow of toast.
        Parameters:
        hide - true whether the shadow of toast
      • setAutoHide

        public final void setAutoHide​(boolean hide)
        Sets whether to make the toast notification sticky, which means that the toast notification will never auto dismiss until clicked.
        Parameters:
        hide - whether to make the toast notification sticky, which means that the toast notification will never auto dismiss until clicked
      • setTimeout

        public final void setTimeout​(int timeout)
        Sets how long the toast notification should last.
        Parameters:
        timeout - how long the toast notification should last
      • setIcon

        public final void setIcon​(Img icon)
        Sets the icon image set for toast.
        Parameters:
        icon - the icon image set for toast
      • setBorderRadius

        public final void setBorderRadius​(int borderRadius)
        Sets the border radius (in pixels) of toast container.
        Parameters:
        borderRadius - the border radius (in pixels) of toast container
      • setModifierKey

        public final void setModifierKey​(ModifierKey modifierKey)
        Sets the modifier key to close the toast by clicking on it.
        Parameters:
        modifierKey - the modifier key to close the toast by clicking on it
      • setAlign

        public final void setAlign​(Align align)
        Sets the alignment of the toast action.
        Parameters:
        align - the alignment of the toast action
      • getProgressBarHeight

        public final int getProgressBarHeight()
        Returns the height (in pixels) of the toast progress bar.
        Specified by:
        getProgressBarHeight in interface IsDefaultToastOptions
        Returns:
        the height (in pixels) of the toast progress bar
      • isHideProgressBar

        public final boolean isHideProgressBar()
        Returns true whether to hide the progress bar.
        Specified by:
        isHideProgressBar in interface IsDefaultToastOptions
        Returns:
        true whether to hide the progress bar
      • isHideShadow

        public final boolean isHideShadow()
        Returns true whether to hide the shadow of toast.
        Specified by:
        isHideShadow in interface IsDefaultToastOptions
        Returns:
        true whether to hide the shadow of toast
      • isAutoHide

        public final boolean isAutoHide()
        Returns whether to make the toast notification sticky, which means that the toast notification will never auto dismiss until clicked.
        Specified by:
        isAutoHide in interface IsDefaultToastOptions
        Returns:
        whether to make the toast notification sticky, which means that the toast notification will never auto dismiss until clicked
      • getTimeout

        public final int getTimeout()
        Returns how long the toast notification should last.
        Specified by:
        getTimeout in interface IsDefaultToastOptions
        Returns:
        how long the toast notification should last
      • getIcon

        public final Img getIcon()
        Returns the icon image set for toast.
        Specified by:
        getIcon in interface IsDefaultToastOptions
        Returns:
        the icon image set for toast
      • getBorderRadius

        public int getBorderRadius()
        Returns the border radius (in pixels).
        Specified by:
        getBorderRadius in interface IsDefaultToastOptions
        Returns:
        the border radius (in pixels).
      • getModifierKey

        public ModifierKey getModifierKey()
        Returns the modifier key to close the toast by clicking on it.
        Specified by:
        getModifierKey in interface IsDefaultToastOptions
        Returns:
        the modifier key to close the toast by clicking on it
      • getAlign

        public final Align getAlign()
        Returns the alignment of the toast action.
        Specified by:
        getAlign in interface IsDefaultToastOptions
        Returns:
        the alignment of the toast action