{"id":16550779,"url":"https://github.com/janczizikow/androiddialogpicker","last_synced_at":"2025-03-21T10:32:05.465Z","repository":{"id":57151448,"uuid":"200060626","full_name":"janczizikow/AndroidDialogPicker","owner":"janczizikow","description":"A simple custom dialog with multiple list items for Android","archived":false,"fork":false,"pushed_at":"2023-12-08T10:44:55.000Z","size":418,"stargazers_count":13,"open_issues_count":2,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-18T00:37:31.436Z","etag":null,"topics":["android","dialog","react-native"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/janczizikow.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-08-01T13:58:01.000Z","updated_at":"2022-02-12T14:45:38.000Z","dependencies_parsed_at":"2024-10-28T10:18:45.879Z","dependency_job_id":"04d775b4-fb24-46ea-b006-b61c16e5222e","html_url":"https://github.com/janczizikow/AndroidDialogPicker","commit_stats":{"total_commits":12,"total_committers":2,"mean_commits":6.0,"dds":0.25,"last_synced_commit":"44cb11955887081abb235c6f000305a9bd430b42"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janczizikow%2FAndroidDialogPicker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janczizikow%2FAndroidDialogPicker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janczizikow%2FAndroidDialogPicker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/janczizikow%2FAndroidDialogPicker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/janczizikow","download_url":"https://codeload.github.com/janczizikow/AndroidDialogPicker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244777974,"owners_count":20508823,"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":["android","dialog","react-native"],"created_at":"2024-10-11T19:35:23.605Z","updated_at":"2025-03-21T10:32:04.960Z","avatar_url":"https://github.com/janczizikow.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# react-native-android-dialog-picker\n\n\u003e\n\n[![NPM](https://img.shields.io/npm/v/react-native-android-dialog-picker.svg?style=flat-square)](https://www.npmjs.com/package/react-native-android-dialog-picker)\n\nA simple custom dialog with multiple list items.\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/janczizikow/AndroidDialogPicker/master/example/example.png\" height=\"500px\" /\u003e\n\u003c/p\u003e\n\n# Why?\n\nRN 0.59.1+ has a bug with Picker component not rendered as a modal, even when passing props: https://github.com/facebook/react-native/issues/24055\nI needed to create a simple Dialog with options (without checkboxes / radio boxes) and didn't wanted to wait until the issue with Picker is fixed. This is a temporary quick solution for the problem.\n\n## React Native Compatibility\n\n| `react-native-android-dialog-picker` version | Required React Native Version                                                     |\n| -------------------------------------------- | --------------------------------------------------------------------------------- |\n| `0.1.x`                                      | `\u003e= 0.60` or `\u003e= 0.59` if using [Jetifier](https://github.com/mikehardy/jetifier) |\n| `0.0.x`                                      | `\u003c= 0.59`                                                                         |\n\n## Getting started\n\n`$ yarn add react-native-android-dialog-picker`\n\nor\n\n`$ npm install react-native-android-dialog-picker --save`\n\n### Mostly automatic installation\n\nOnly necessary for React Native \u003c= 0.59\n\n`$ react-native link react-native-android-dialog-picker`\n\n### Manual installation\n\n#### Android\n\n1. Open up `android/app/src/main/java/[...]/MainActivity.java`\n  - Add `import com.androiddialogpicker.RNAndroidDialogPickerPackage;` to the imports at the top of the file\n  - Add `new RNAndroidDialogPickerPackage()` to the list returned by the `getPackages()` method\n2. Append the following lines to `android/settings.gradle`:\n  \t```\n  \tinclude ':react-native-android-dialog-picker'\n  \tproject(':react-native-android-dialog-picker').projectDir = new File(rootProject.projectDir, \t'../node_modules/react-native-android-dialog-picker/android')\n  \t```\n3. Insert the following lines inside the dependencies block in `android/app/build.gradle`:\n  \t```\n      compile project(':react-native-android-dialog-picker')\n  \t```\n\n## Usage\n```javascript\nimport React, { Component } from \"react\";\nimport {\n  Platform,\n  View,\n  Button,\n  ActionSheetIOS\n} from \"react-native\";\nimport AndroidDialogPicker from \"react-native-android-dialog-picker\";\n\nexport default class App extends Component {\n  showPicker = () =\u003e {\n    if (Platform.OS === \"android\") {\n      // only for android\n      AndroidDialogPicker.show(\n        {\n          title: \"Title\", // title of the dialog\n          items: [\"Item1\", \"Item2\"], // items/options to choose from\n          cancelText: \"Cancel\" // cancel text (optional - cancel button won't be render if this is not passed)\n        },\n        // only called when pressed on one of the items\n        // won't be called if user pressed on cancel or dismissed the dialog\n        buttonIndex =\u003e {\n          console.log(buttonIndex);\n        }\n      );\n    } else {\n      // use ActionSheetIOS for iOS\n      ActionSheetIOS.showActionSheetWithOptions(\n        {\n          title: \"Title\",\n          options: [\"Item1\", \"Item2\", \"Cancel\"],\n          cancelButtonIndex: 2\n        },\n        buttonIndex =\u003e {\n          console.log(buttonIndex);\n        }\n      );\n    }\n  };\n\n  render() {\n    return (\n      \u003cView style={{flex: 1}}\u003e\n        \u003cButton title=\"Show Me What You Got\" onPress={this.showPicker} /\u003e\n      \u003c/View\u003e\n    );\n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjanczizikow%2Fandroiddialogpicker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjanczizikow%2Fandroiddialogpicker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjanczizikow%2Fandroiddialogpicker/lists"}