## react-native-dialogs [![All Contributors](https://img.shields.io/badge/all_contributors-25-orange.svg?style=flat-square)](#contributors) An Android only module for Material Design dialogs. This is a wrapper over [afollestad/material-dialogs](https://github.com/afollestad/material-dialogs). This module is designed for Android only with no plans to support iOS. ### Table of Contents - [Installation](#installation) - [Manual Linking](#manual-linking) - [Usage](#usage) - [API](#api) - [Properties](#properties) - [`defaults`](#defaults) - [`actionDismiss`](#actiondismiss) - [`actionNegative`](#actionnegative) - [`actionNeutral`](#actionneutral) - [`actionPositive`](#actionpositive) - [`listPlain`](#listplain) - [`listRadio`](#listradio) - [`listCheckbox`](#listcheckbox) - [`progressHorizontal`](#progresshorizontal) - [Methods](#methods) - [`alert`](#alert) - [`assignDefaults`](#assigndefaults) - [`dismiss`](#dismiss) - [`prompt`](#prompt) - [`showPicker`](#showpicker) - [`showProgress`](#showprogress) - [Types](#types) - [Internal Types](#internal-types) - [`type ActionType`](#type-actiontype) - [`type ListItem`](#type-listitem) - [`type ListType`](#type-listtype) - [`type OptionsAlert`](#type-optionsalert) - [`type OptionsCheckbox`](#type-optionscheckbox) - [`type OptionsCommon`](#type-optionscommon) - [`type OptionsProgress`](#type-optionsprogress) - [`type OptionsPicker`](#type-optionspicker) - [`type OptionsPrompt`](#type-optionsprompt) - [`type ProgressStyle`](#type-progressstyle) - [Examples](#examples) - [Progress Dialog](#progress-dialog) - [Basic List](#basic-list) - [Radio List](#radio-list) - [Without auto-dismiss](#without-auto-dismiss) - [Checklist](#checklist) - [With clear list button](#with-clear-list-button) - [Prompt](#prompt) - [HTML](#html) - [assignDefaults](#assigndefaults) - [Contributors](#contributors) ### Installation **Note**: This page shows the documentation for version `1.0.0-rc1`, which is complete rewrite of the library, and is currenlty being tested. For the old version, please visit https://npmjs.com/react-native-dialogs. 1. Install: - Using [npm](https://www.npmjs.com/#getting-started): `npm install react-native-dialogs@next --save` - Using [Yarn](https://yarnpkg.com/): `yarn add react-native-dialogs@next` 2. [Link](https://facebook.github.io/react-native/docs/linking-libraries-ios.html): - `react-native link react-native-dialogs` - Or if this fails, link manually using [these steps](#manual-linking) 3. Compile application using `react-native run-android` #### Manual Linking Follow these steps if automatic linking (`react-native link`) failed. 1. Include this module in `android/settings.gradle`: ``` ... include ':autocompletetextview' // Add this project(':autocompletetextview').projectDir = file("../node_modules/autocompletetextview/android") // Add this ... include ':app' ``` 2. In `android/app/build.gradle`, add the dependency to your app build: ``` dependencies { ... compile project(':react-native-dialogs') // Add this } ``` 3. In `android/build.gradle`, it should already be there, but in case it is not, add Jitpack maven repository to download the library [afollestad/material-dialogs](https://github.com/afollestad/material-dialogs): ``` allprojects { repositories { ... jcenter() // Add this if it is not already here ... } } ``` 4. In `android/settings.gradle`: ``` rootProject.name = ... ... include ':react-native-dialogs' // Add this project(':react-native-dialogs').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-dialogs/android') // Add this ... include ':app' ``` 5. Import and add package, in `android/app/src/main/.../MainApplication.java`: ```java ... import android.app.Application; ... import com.aakashns.reactnativedialogs.ReactNativeDialogsPackage; // Add new import ... public class MainApplication extends Application implements ReactApplication { ... @Override protected List getPackages() { return Arrays.asList( new MainReactPackage(), ... new ReactNativeDialogsPackage() // Add the package here ); } } ``` ### Usage 1. Import it in your JS: ```js import DialogAndroid from 'react-native-dialogs'; ``` 2. Call API: ```js class Blah extends Component { render() { return