{"id":4225,"url":"https://github.com/lucasferreira/react-native-simpledialog-android","last_synced_at":"2025-08-04T00:32:38.543Z","repository":{"id":57340106,"uuid":"45624411","full_name":"lucasferreira/react-native-simpledialog-android","owner":"lucasferreira","description":"React Native Android module to use Android's AlertDialog - same idea of AlertIOS","archived":true,"fork":false,"pushed_at":"2017-10-09T00:47:08.000Z","size":18,"stargazers_count":43,"open_issues_count":0,"forks_count":19,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-09T18:22:48.330Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lucasferreira.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-11-05T16:35:20.000Z","updated_at":"2023-03-09T02:21:19.000Z","dependencies_parsed_at":"2022-08-26T04:31:38.254Z","dependency_job_id":null,"html_url":"https://github.com/lucasferreira/react-native-simpledialog-android","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucasferreira%2Freact-native-simpledialog-android","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucasferreira%2Freact-native-simpledialog-android/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucasferreira%2Freact-native-simpledialog-android/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucasferreira%2Freact-native-simpledialog-android/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lucasferreira","download_url":"https://codeload.github.com/lucasferreira/react-native-simpledialog-android/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228576898,"owners_count":17939645,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-01-05T20:17:05.062Z","updated_at":"2024-12-07T07:31:33.185Z","avatar_url":"https://github.com/lucasferreira.png","language":"Java","funding_links":[],"categories":["Components","Others"],"sub_categories":["UI"],"readme":"# react-native-simpledialog-android\nReact Native Android module to use Android's AlertDialog - same idea of AlertIOS\n\n[![npm version](http://img.shields.io/npm/v/react-native-simpledialog-android.svg?style=flat-square)](https://npmjs.org/package/react-native-simpledialog-android \"View this project on npm\")\n[![npm downloads](http://img.shields.io/npm/dm/react-native-simpledialog-android.svg?style=flat-square)](https://npmjs.org/package/react-native-simpledialog-android \"View this project on npm\")\n[![npm licence](http://img.shields.io/npm/l/react-native-simpledialog-android.svg?style=flat-square)](https://npmjs.org/package/react-native-simpledialog-android \"View this project on npm\")\n\n\n### Installation\n\n```bash\nnpm install react-native-simpledialog-android --save\n```\n\n### Add it to your android project\n\n* In `android/settings.gradle`\n\n```gradle\n...\ninclude ':RNSimpleAlertDialogModule', ':app'\nproject(':RNSimpleAlertDialogModule').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-simpledialog-android/android')\n```\n\n* In `android/app/build.gradle`\n\n```gradle\n...\ndependencies {\n    ...\n    compile project(':RNSimpleAlertDialogModule')\n}\n```\n\n* Register Module \u003e= 0.17 \u0026\u0026 \u003c= 0.29(in ```MainActivity.java```)\n* NOTE: \u003e= RN 29 split ```MainActivity.java``` into ```MainActivity.java``` and\n  ```MainApplication.java```.  So make modifications below to ```MainApplication.java```\n\n```java\nimport com.burnweb.rnsimplealertdialog.RNSimpleAlertDialogPackage;  // \u003c--- import\n\npublic class MainApplication extends Application implements ReactApplication {\n  ......\n\n  @Override\n  protected List\u003cReactPackage\u003e getPackages() {\n    return Arrays.\u003cReactPackage\u003easList(\n            new MainReactPackage(),\n            new RNSimpleAlertDialogPackage()); // \u003c------ add this line to your MainApplication class\n  }\n\n  ......\n\n}\n```\n\n## Usage\nThis module are very similar to [AlertIOS](https://facebook.github.io/react-native/docs/alertios.html) native module, and only works with **alert** method *(prompt method aren't implemented yet)*.\n\nThe main difference are in the way that you declare buttons. In Android you can declare **up to 3 buttons** and in this module you have to declare what **type** the button is.\nA button can be **SimpleAlert.POSITIVE_BUTTON**, **SimpleAlert.NEGATIVE_BUTTON** or **SimpleAlert.NEUTRAL_BUTTON**.\n\n## Example\n```javascript\nvar SimpleAlert = require('react-native-simpledialog-android');\n\nfunction _onPress(event) {\n    console.log(event);\n};\n\nSimpleAlert.alert(\n    'Please read me!',\n    'Want a warning alert?', [\n      { type: SimpleAlert.POSITIVE_BUTTON, text: 'Yes', onPress: _onPress },\n      { type: SimpleAlert.NEGATIVE_BUTTON, text: 'No', onPress: _onPress },\n      { type: SimpleAlert.NEUTRAL_BUTTON, text: 'Neutral', onPress: _onPress },\n    ]\n);\n```\n\n## License\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucasferreira%2Freact-native-simpledialog-android","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flucasferreira%2Freact-native-simpledialog-android","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucasferreira%2Freact-native-simpledialog-android/lists"}