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
This commit is contained in:
Damien 2016-09-19 06:39:30 -07:00 коммит произвёл Facebook Github Bot 1
Родитель 8b8c2ece7b
Коммит 644b93dc11
1 изменённых файлов: 7 добавлений и 1 удалений

Просмотреть файл

@ -21,7 +21,13 @@ var RCTToastAndroid = require('NativeModules').ToastAndroid;
* 2. int duration: The duration of the toast. May be ToastAndroid.SHORT or ToastAndroid.LONG * 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 * 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 = { var ToastAndroid = {