├── .gitignore
├── LICENSE.md
├── README.md
├── build.gradle
├── index.js
├── package.json
├── screenshots
├── Screenshot_2016-05-31-20-29-17.png
├── Screenshot_2016-05-31-20-29-26.png
├── Screenshot_2016-05-31-20-29-34.png
└── Screenshot_2016-05-31-20-29-41.png
└── src
└── main
├── AndroidManifest.xml
└── java
└── com
└── arjunkomath
└── react
├── MaterialDialogModule.java
└── MaterialDialogPackage.java
/.gitignore:
--------------------------------------------------------------------------------
1 | # Logs
2 | logs
3 | *.log
4 |
5 | # Runtime data
6 | pids
7 | *.pid
8 | *.seed
9 |
10 | # Directory for instrumented libs generated by jscoverage/JSCover
11 | lib-cov
12 |
13 | # Coverage directory used by tools like istanbul
14 | coverage
15 |
16 | # Grunt intermediate storage
17 | # (http://gruntjs.com/creating-plugins#storing-task-files)
18 | .grunt
19 |
20 | # node-waf configuration
21 | .lock-wscript
22 |
23 | # Compiled binary addons (http://nodejs.org/api/addons.html)
24 | build/Release
25 |
26 | # Dependency directory
27 | # https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
28 | node_modules
29 | npm-debug.log
30 |
31 | # OSX
32 | #
33 | .DS_Store
34 |
35 | examples/
36 |
37 | # Xcode
38 | #
39 | build/
40 | *.pbxuser
41 | !default.pbxuser
42 | *.mode1v3
43 | !default.mode1v3
44 | *.mode2v3
45 | !default.mode2v3
46 | *.perspectivev3
47 | !default.perspectivev3
48 | xcuserdata
49 | *.xccheckout
50 | *.moved-aside
51 | DerivedData
52 | *.hmap
53 | *.ipa
54 | *.xcuserstate
55 | project.xcworkspace
56 |
57 | # Android/IJ
58 | #
59 | .idea
60 | .gradle
61 | local.properties
62 | android/*.iml
63 |
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2016 Arjun Komath
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
React Native Material Dialogs (Android)
2 | Material Design Dialogs for React Native
3 |
4 | [](https://badge.fury.io/js/react-native-material-dialogs)
5 | [](https://github.com/arjunkomath/react-native-material-dialogs/stargazers)
6 | [](https://codeclimate.com/github/arjunkomath/react-native-material-dialogs)
7 | [](https://gitter.im/arjunkomath/react-native-material-dialogs?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
8 |
9 | [](https://nodei.co/npm/react-native-material-dialogs/)
10 |
11 | 
12 | 
13 | 
14 |
15 | ## Install
16 |
17 | Install the npm module.
18 | ```
19 | npm i react-native-material-dialogs
20 | ```
21 |
22 | ### Plugin Installation (Android - Manual)
23 |
24 | - In your android/settings.gradle file, make the following additions:
25 | ```
26 | include ':react-native-material-dialogs'
27 | project(':react-native-material-dialogs').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-material-dialogs')
28 | ```
29 |
30 | - In your android/build.gradle file, add the a maven repository:
31 | ```
32 | ...
33 | repositories {
34 | ...
35 | maven { url "https://jitpack.io" }
36 | }
37 | ```
38 | - In your android/app/build.gradle file, add the a compile-time dependency:
39 | ```
40 | ...
41 | dependencies {
42 | ...
43 | compile project(':react-native-material-dialogs')
44 | }
45 | ```
46 | - Next, you need to change the MainActivity of your app.
47 |
48 | ```java
49 | import com.arjunkomath.react.MaterialDialogPackage; // <--- Add This
50 |
51 | ...
52 | /**
53 | * A list of packages used by the app. If the app uses additional views
54 | * or modules besides the default ones, add more packages here.
55 | */
56 | @Override
57 | protected List getPackages() {
58 | return Arrays.asList(
59 | new MainReactPackage(),
60 | new MaterialDialogPackage(this) // "this" is very important!
61 | );
62 | }
63 | ```
64 |
65 | And, you're done!
66 |
67 | ## Usage
68 |
69 | ```
70 | import MaterialDialog from 'react-native-material-dialogs';
71 | ```
72 |
73 | There are two types of dialogs:
74 |
75 | ### Dialog with one feedback
76 |
77 | ```
78 | MaterialDialog.show('Yaaay!!', 'Success', 'done', MaterialDialog.SUCCESS,
79 | () => {
80 | console.log('asd');
81 | });
82 | ```
83 |
84 | Parameters:
85 |
86 | ```
87 | MaterialDialog.show( , ,