Module ToastAndroid-BsReactNative

type duration =
| LONG
| SHORT
;

You can read more on ToastAndroid API usage in official docs: https://facebook.github.io/react-native/docs/toastandroid

ToastAndroid module provides simple feedback in the small popup.

Example of use

default
ToastAndroid.show("A pikachu appeared nearby !", ToastAndroid.SHORT); 
show with gravity
ToastAndroid.showWithGravity(
  "All Your Base Are Belong To Us",
  ToastAndroid.SHORT,
  ToastAndroid.CENTER
);
show with gravity and add offset
ToastAndroid.showWithGravityAndOffset(
  "A wild toast appeared!",
  ToastAndroid.LONG,
  ToastAndroid.BOTTOM,
  25,
  50
);

Methods

show
type duration =
| BOTTOM
| CENTER;
| LONG
| SHORT
| TOP

(string, duration) => unit;
showWithGravity
type gravity =
  | BOTTOM
  | CENTER;
  | TOP

let showWithGravity: (string, duration, gravity) => unit;
showGravityAndOffset
type gravity =
 | BOTTOM
 | CENTER;
 | TOP

let showWithGravityAndOffset: (string, duration, gravity, int, int) => unit;

Properties

  • BOTTOM

    ToastAndroid.BOTTOM 
  • CENTER

    ToastAndroid.CENTER 
  • LONG

    ToastAndroid.LONG 
  • SHORT

    ToastAndroid.SHORT 
  • TOP

    ToastAndroid.TOP 
type gravity =
| BOTTOM
| CENTER
| TOP
;
let show: string => duration:duration => ?⁠gravity:gravity => ?⁠offset:(int, int) => unit => unit;