Interface IToast<TEvent>

Since

4.4.1 Toast provide brief messages about app processes at the bottom of the screen.

Example

import Toast from '@smartface/native/ui/toast';
const myToastMessage = new Toast({
message: "This is a toast message",
actionTextColor: Color.YELLOW,
bottomOffset: 200,
duration: 5
});
myToastMessage.createAction("Action Title", () => {console.log("Action Pressed!")})
myToastMessage.show();

Type Parameters

Hierarchy

Methods

  • Creates an event emitter instance to listen for the actions

    Returns

    Call the function to remove the event

    Parameters

    Returns (() => void)

      • (): void
      • Creates an event emitter instance to listen for the actions

        Returns

        Call the function to remove the event

        Returns void

  • Creates an event emitter instance to listen for the actions

    Returns

    Call the function to remove the event

    Parameters

    Returns (() => void)

      • (): void
      • Creates an event emitter instance to listen for the actions

        Returns

        Call the function to remove the event

        Returns void

  • Removes the specified event and invokes the callback after it is removed

    Parameters

    Returns void

  • Triggers the event manually.

    Parameters

    • event: "dismissed" | TEvent
    • Rest ...args: any[]

      Arguments that needs to be passed down

    Returns void

  • Adds the listener function to the beginning of the listeners array for the event named eventName. No checks are made to see if the listener has already been added. Multiple calls passing the same combination of eventName and listener will result in the listener being added, and called, multiple times.

    Parameters

    Returns void

  • Adds a one-time listener function for the event named eventName to the beginning of the listeners array. The next time eventName is triggered, this listener is removed, and then invoked.

    Parameters

    Returns void

  • Add an action to toast.

    Android

    Ios

    Since

    4.4.1

    Parameters

    • title: string

      of action.

    • callback: (() => void)
        • (): void
        • Returns void

    Returns void

  • This method shows the toast on the screen.

    Android

    Ios

    Since

    4.4.1

    Returns void

  • Dismisses the Toast, isShowing property set to false after this operation.

    Android

    Ios

    Since

    4.4.1

    Returns void

Properties

nativeObject: { [key: string]: any }

Type declaration

  • [key: string]: any
message: string

Gets/sets the message of toast.

Android

Ios

Property

Since

4.4.1

backgroundColor: IColor

Gets/sets the background of toast message view.

Android

Ios

Property

Since

4.4.1

actionTextColor: IColor

Gets/sets the actionTextColor of toast action text.

Android

Ios

Property

Since

4.4.1

messageTextColor: IColor

Gets/sets the messageTextColor of toast message text.

Android

Ios

Property

Since

4.4.1

bottomOffset: number

Gets/sets the bottom offset of toast message view from bottom.

Android

Ios

Property

Since

4.4.1

duration: number

Gets/sets how long it will stay on the screen. Value can bet set between 1 - 10 as integer

Android

Ios

Property

Since

4.4.1

isShowing: boolean

Gets status of the toast. Returns true if the toast is currently displayed on the screen.

Android

Ios

Property

Since

4.4.1

onDismissed: ((callback: void) => void)

Type declaration

    • (callback: void): void
    • This function called when displayed toast dismissed.

      Android

      Ios

      Since

      4.4.1

      Parameters

      • callback: void

        function called when toast dismissed.

      Returns void

Generated using TypeDoc