Skip to content
This repository has been archived by the owner on Sep 9, 2024. It is now read-only.

Commit

Permalink
README
Browse files Browse the repository at this point in the history
  • Loading branch information
Talut TASGIRAN committed Jan 24, 2019
1 parent 3d43649 commit ecbac32
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 1 deletion.
21 changes: 21 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2019 Talut TASGIRAN

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
34 changes: 33 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
With this package you can easily use picker with onPress function.
Also this package is workaround for Android Picker problem (https://github.com/facebook/react-native/issues/15556).

This package is using `Modal` and `Picker` component for IOS and using `RecyclerView` and `AlertDialog` for Android as `NativeModule`.
Using `Modal` and `Picker` component for IOS and using `RecyclerView` and `AlertDialog` for Android as `NativeModule`.


<img src="./docs/android-picker-module.png"> <img src="./docs/ios-picker-module.png">
Expand Down Expand Up @@ -80,4 +80,36 @@ state = {
}}/>
```

## P.S
You can use more than one picker in same screen. You just need to set different pickerRef.
```javascript
this.languagePicker.show();

<ReactNativePickerModule
pickerRef={e => this.languagePicker = e}
value={this.state.selectedValue}
title={"Select a language"}
items={this.state.data}
onValueChange={(index) => {
this.setState({
selectedValue: index
})
}}/>
```
p.s : If you want to get country list from native device you can use this package: https://github.com/talut/react-native-countries
```javascript
this.countryPicker.show();
<ReactNativePickerModule
pickerRef={e => this.countryPicker = e}
value={this.state.selectedValue}
title={"Select a country"}
items={this.state.data}
onValueChange={(index) => {
this.setState({
selectedValue: index
})
}}/>
```

## License
This project is licensed under the MIT License - see the LICENSE.md file for details

0 comments on commit ecbac32

Please sign in to comment.