From 33c99463757db74bf9fbf8d0f3231c4d9f0ed4cc Mon Sep 17 00:00:00 2001 From: Website Deployment Script Date: Wed, 20 Jul 2016 16:44:24 +0000 Subject: [PATCH] Updated docs for next --- releases/next/docs/toastandroid.html | 41 ++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/releases/next/docs/toastandroid.html b/releases/next/docs/toastandroid.html index 2f6539a98cf..55c738ed5c0 100644 --- a/releases/next/docs/toastandroid.html +++ b/releases/next/docs/toastandroid.html @@ -1,5 +1,6 @@ ToastAndroid – React Native | A framework for building native apps using React

ToastAndroid #

Edit on GitHub

This exposes the native ToastAndroid module as a JS module. This has a function 'show' -which takes the following parameters:

  1. String message: A string with the text to toast
  2. int duration: The duration of the toast. May be ToastAndroid.SHORT or ToastAndroid.LONG

Methods #

static show(message, duration) #

Properties #

SHORT: MemberExpression #

LONG: MemberExpression #

Examples #

Edit on GitHub
'use strict'; +which takes the following parameters:

  1. String message: A string with the text to toast
  2. int duration: The duration of the toast. May be ToastAndroid.SHORT or ToastAndroid.LONG

There is also a function showWithGravity to specify the layout gravity. May be +ToastAndroid.TOP, ToastAndroid.BOTTOM, ToastAndroid.CENTER

Methods #

static show(message, duration) #

static showWithGravity(message, duration, gravity) #

Properties #

SHORT: MemberExpression #

// Toast duration constants

LONG: MemberExpression #

TOP: MemberExpression #

// Toast gravity constants

BOTTOM: MemberExpression #

CENTER: MemberExpression #

Examples #

Edit on GitHub
'use strict'; var React = require('react'); var ReactNative = require('react-native'); @@ -38,7 +39,43 @@ which takes the following parameters:

  1. String message: A string with t <TouchableWithoutFeedback onPress={() => ToastAndroid.show('This is a toast with long duration', ToastAndroid.LONG)}> - <Text style={styles.text}>Click me too.</Text> + <Text style={styles.text}>Click me.</Text> + </TouchableWithoutFeedback> + </UIExplorerBlock> + <UIExplorerBlock title="Toast with top gravity"> + <TouchableWithoutFeedback + onPress={() => + ToastAndroid.showWithGravity( + 'This is a toast with top gravity', + ToastAndroid.SHORT, + ToastAndroid.TOP, + ) + }> + <Text style={styles.text}>Click me.</Text> + </TouchableWithoutFeedback> + </UIExplorerBlock> + <UIExplorerBlock title="Toast with center gravity"> + <TouchableWithoutFeedback + onPress={() => + ToastAndroid.showWithGravity( + 'This is a toast with center gravity', + ToastAndroid.SHORT, + ToastAndroid.CENTER, + ) + }> + <Text style={styles.text}>Click me.</Text> + </TouchableWithoutFeedback> + </UIExplorerBlock> + <UIExplorerBlock title="Toast with bottom gravity"> + <TouchableWithoutFeedback + onPress={() => + ToastAndroid.showWithGravity( + 'This is a toast with bottom gravity', + ToastAndroid.SHORT, + ToastAndroid.BOTTOM, + ) + }> + <Text style={styles.text}>Click me.</Text> </TouchableWithoutFeedback> </UIExplorerBlock> </UIExplorerPage>