## 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 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-1) - [HTML](#html) - [assignDefaults](#assigndefaults-1) - [Contributors](#contributors) ### Installation 1. Install: - Using [npm](https://www.npmjs.com/#getting-started): `npm install react-native-dialogs --save` - Using [Yarn](https://yarnpkg.com/): `yarn add react-native-dialogs` 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. In `android/app/build.gradle`, add the dependency to your app build: ``` dependencies { ... compile project(':react-native-dialogs') // Add this } ``` 2. 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 ... } } ``` 3. 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' ``` 4. 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