From 644b93dc1179678e360465a2a3fa5f8d01ff4879 Mon Sep 17 00:00:00 2001 From: Damien Date: Mon, 19 Sep 2016 06:39:30 -0700 Subject: [PATCH] Add very basic usage example for android toast Summary: Currently, it's hard to find out that it's very easy to use android toasts. The example is very complex and hard to grasp for a beginner. So, I propose to add an easy to understand example. I'm sure the syntax of this PR is not really correct, it's just a start to show the kind of thing I propose. Closes https://github.com/facebook/react-native/pull/9859 Differential Revision: D3886274 Pulled By: donyu fbshipit-source-id: 15e693f5ddb1efea0fc6b7accfa688fd5f99a100 --- Libraries/Components/ToastAndroid/ToastAndroid.android.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Libraries/Components/ToastAndroid/ToastAndroid.android.js b/Libraries/Components/ToastAndroid/ToastAndroid.android.js index ac03e62d48..36899ca30f 100644 --- a/Libraries/Components/ToastAndroid/ToastAndroid.android.js +++ b/Libraries/Components/ToastAndroid/ToastAndroid.android.js @@ -21,7 +21,13 @@ var RCTToastAndroid = require('NativeModules').ToastAndroid; * 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 + * ToastAndroid.TOP, ToastAndroid.BOTTOM, ToastAndroid.CENTER. + * + * Basic usage: + * ```javascript + * ToastAndroid.show('A pikachu appeared nearby !', ToastAndroid.SHORT); + * ToastAndroid.showWithGravity('All Your Base Are Belong To Us', ToastAndroid.SHORT, ToastAndroid.CENTER); + * ``` */ var ToastAndroid = {