Class ToastComponent


public class ToastComponent extends ContainerComponent
Passive toast surface managed by the GUI or HUD toast runtime.
  • Constructor Details

    • ToastComponent

      public ToastComponent()
      Creates a toast with a compact default presentation.
  • Method Details

    • durationSeconds

      public ToastComponent durationSeconds(double durationSeconds)
      Sets the toast lifetime before automatic dismissal. A value less than or equal to 0 disables automatic dismissal.
      Parameters:
      durationSeconds - lifetime in seconds
      Returns:
      this component
    • enterDurationSeconds

      public ToastComponent enterDurationSeconds(double enterDurationSeconds)
      Sets the enter animation duration in seconds.
      Parameters:
      enterDurationSeconds - enter animation duration
      Returns:
      this component
    • exitDurationSeconds

      public ToastComponent exitDurationSeconds(double exitDurationSeconds)
      Sets the exit animation duration in seconds.
      Parameters:
      exitDurationSeconds - exit animation duration
      Returns:
      this component
    • enterOffsetX

      public ToastComponent enterOffsetX(float enterOffsetX)
      Sets the horizontal enter offset used by the default toast animation.
      Parameters:
      enterOffsetX - enter offset in design-space pixels
      Returns:
      this component
    • exitOffsetX

      public ToastComponent exitOffsetX(float exitOffsetX)
      Sets the horizontal exit offset used by the default toast animation.
      Parameters:
      exitOffsetX - exit offset in design-space pixels
      Returns:
      this component
    • onShown

      public ToastComponent onShown(Runnable onShown)
      Sets a callback invoked once the toast has entered the visible stack.
      Parameters:
      onShown - shown callback
      Returns:
      this component
    • onDismissed

      public ToastComponent onDismissed(Runnable onDismissed)
      Sets a callback invoked once the toast has fully dismissed.
      Parameters:
      onDismissed - dismissed callback
      Returns:
      this component