From 11558e9880f400a83326dbff0a29667068f62d89 Mon Sep 17 00:00:00 2001 From: Aakash N S Date: Mon, 2 Nov 2015 03:55:33 +0530 Subject: [PATCH] Update README.md --- README.md | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 79 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4e4e8e7..ed316c0 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # react-native-dialogs -React Native wrappers for https://github.com/afollestad/material-dialogs +Material Design dialogs for React Native Android apps (wrappers over https://github.com/afollestad/material-dialogs) + Installation ------------ @@ -108,3 +109,80 @@ The following options are currently supported (value type is `String` unless men * [`type`](https://github.com/afollestad/material-dialogs#input-dialogs) (int) * [`callback`](https://github.com/afollestad/material-dialogs#input-dialogs) (function with 1 argument : user provided input) * [`alwaysCallInputCallback`](https://github.com/afollestad/material-dialogs#input-dialogs) (boolean) + +Examples +-------- + +Try out the following values for option (taken from [examples/ExampleApp/dialogData.js](./examples/ExampleApp/dialogData.js)): + +```javascript +{ + "title": "Use Google's Location Services?", + "content": "This app wants to access your location.", + "positiveText": "Agree", + "negativeText": "Disagree" +} +``` + +```javascript +{ + "title": "Use Google's Location Services?", + "content": "Let Google help apps determine location. This means sending anonymous location data to Google, even when no apps are running.", + "positiveText": "Agree", + "negativeText": "Disagree", + "neutralText": "More Info", + "onPositive": () => ToastAndroid.show("POSITIVE!", ToastAndroid.SHORT), + "onNegative": () => ToastAndroid.show("NEGATIVE!", ToastAndroid.SHORT), + "onNeutral": () => ToastAndroid.show("NEUTRAL!", ToastAndroid.SHORT), +} +``` + +```javascript +"data": { + "items": [ + "Twitter", + "Google+", + "Instagram", + "Facebook" + ], + "title": "Social Networks", + itemsCallback: (id, text) => ToastAndroid.show(id + ": " + text, ToastAndroid.SHORT); +} +``` + +```javascript +"data": { + "items": [ + "Twitter", + "Google+", + "Instagram", + "Facebook" + ], + "title": "Social Networks", + itemsCallbackSingleChoice: (id, text) => ToastAndroid.show(id + ": " + text, ToastAndroid.SHORT); +} +``` + +```javascript +"data": { + "items": [ + "Twitter", + "Google+", + "Instagram", + "Facebook" + ], + "title": "Social Networks", + itemsCallbackMultiChoice: (id, text) => ToastAndroid.show(id + ": " + text, ToastAndroid.SHORT); +} +``` + + + +Known Issues +------------ +TODO + +Upcoming Features +------- +TODO +