Skip to content

Commit e95e206

Browse files
author
Xiaosong Gao
committed
Update README.
1 parent d9e4537 commit e95e206

File tree

1 file changed

+52
-15
lines changed

1 file changed

+52
-15
lines changed

README.md

Lines changed: 52 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# react-native-full-image-picker
22

33
[![npm version](https://img.shields.io/npm/v/react-native-full-image-picker.svg?style=flat)](https://www.npmjs.com/package/react-native-full-image-picker)
4+
[![Build Status](https://travis-ci.org/gaoxiaosong/react-native-full-image-picker.svg?branch=master)](https://travis-ci.org/gaoxiaosong/react-native-full-image-picker)
45

56
[中文说明](https://www.jianshu.com/p/4f7296753013)
67

@@ -43,12 +44,12 @@ Install by NPM:
4344
npm install --save react-native-full-image-picker
4445
```
4546

46-
You should also install native code of these libraries:
47+
**NOTICE**: This library has no native code for iOS and Android. But you should also install native code of these libraries:
4748

48-
* [CameraRoll](https://facebook.github.io/react-native/docs/cameraroll)
49-
* [react-native-camera](https://github.com/react-native-community/react-native-camera)
50-
* [react-native-video](https://github.com/react-native-community/react-native-video)
51-
* [react-native-fs](https://github.com/itinance/react-native-fs)
49+
* [CameraRoll](https://facebook.github.io/react-native/docs/cameraroll): Used to get all photos in camera roll or photo library.
50+
* [react-native-camera](https://github.com/react-native-community/react-native-camera): Used to show camera in view.
51+
* [react-native-video](https://github.com/react-native-community/react-native-video): Used to preview the video.
52+
* [react-native-fs](https://github.com/itinance/react-native-fs): Used to copy generated photo or video to a temporary place.
5253

5354
## Usage
5455

@@ -60,28 +61,64 @@ import * as ImagePicker from 'react-native-full-image-picker';
6061

6162
It has three method:
6263

63-
* `ImagePicker.getCamera(options)`: Take photo.
64-
* `ImagePicker.getVideo(options)`: Video recording.
65-
* `ImagePicker.getAlbum(options)`: Select from photo library.
64+
* `ImagePicker.getCamera(options)`: Take photo from camera. (Camera Mode)
65+
* `ImagePicker.getVideo(options)`: Video recording. (Video Mode)
66+
* `ImagePicker.getAlbum(options)`: Select photo or video from photo library. (Photo Mode)
6667

6768
`options` is a object with these settings:
6869

69-
* `callback: (data: any[]) => void`: Callback method with photo or video array. Do not use `Alert` in it.
70-
* `maxSize?: number`: The maximum number of photo count. Valid in camera or photo library.
70+
* `callback: (data: any[]) => void`: Callback method with photo or video array. `data` is an uri array of photo or video. Do not use `Alert` in this callback method.
71+
* `maxSize?: number`: The maximum number of photo count. Valid in camera or photo library mode.
7172
* `sideType?: RNCamera.Constants.Type`: Side of camera, back or front. Valid in camera or video.
7273
* `flashMode?: RNCamera.Constants.FlashMode`: Flash mode. Valid in camera or video.
7374

7475
You can use [react-native-general-actionsheet](https://github.com/gaoxiaosong/react-native-general-actionsheet) to show `ActionSheet` by same API and UI with `ActionSheetIOS`.
7576

76-
## Change Label
77+
## Change Default Property
7778

78-
You can import page and change `defaultProps` to modify labels globally:
79+
You can import page and change `defaultProps` to modify settings globally:
7980

8081
```jsx
8182
import * as ImagePicker from 'react-native-full-image-picker';
8283

83-
ImagePicker.XXXPage.defaultProps.xxx = yyy;
84-
ImagePicker.XXXView.defaultProps.xxx = yyy;
84+
ImagePicker.XXX.defaultProps.yyy = ...;
8585
```
8686

87-
The `XXXPage` or `XXXView` is the export items of library. And you can see source code to modify its `defaultProps` value.
87+
The `XXX` is the export items of library. Following is the detail.
88+
89+
### PhotoModalPage
90+
91+
This is the outter navigator for all modes. You can change these properties of `defaultProps`:
92+
93+
| Name | Type | Description |
94+
| :-: | :-: | :- |
95+
| okLabel | string | OK button text |
96+
| cancelLabel | string | Cancel button text |
97+
| deleteLabel | string | Delete button text
98+
| useVideoLabel | string | UseVideo button text |
99+
| usePhotoLabel | string | UsePhoto button text |
100+
| previewLabel | string | Preview button text |
101+
| choosePhotoTitle | string | ChoosePhoto page title |
102+
| maxSizeChooseAlert | (num: number) => string | Max size limit alert message when choosing photos |
103+
| maxSizeTakeAlert | (num: number) => string | Max size limit alert message when taking photos from camera |
104+
105+
### CameraView
106+
107+
This is page for taking photos from camera or recording video. You can change these properties of `defaultProps`:
108+
109+
| Name | Type | Description |
110+
| :-: | :-: | :- |
111+
| maxSize | number | Default max number limit |
112+
| sideType | RNCamera.Constants.Type | Camera side type. Default is `back` |
113+
| flashMode | RNCamera.Constants.FlashMode | Flash mode. Default is `off` |
114+
115+
### AlbumListView
116+
117+
This is page for selecting photo from photo library. You can change these properties of `defaultProps`:
118+
119+
| Name | Type | Description |
120+
| :-: | :-: | :- |
121+
| maxSize | number | Default max number limit |
122+
| autoConvertPath | boolean | Auto copy photo or not to convert file path to standard file path. Default is `false` |
123+
| assetType | string | Asset type. Please see [CameraRoll Docs](https://facebook.github.io/react-native/docs/cameraroll) |
124+
| groupTypes | string | Group type. Please see [CameraRoll Docs](https://facebook.github.io/react-native/docs/cameraroll) |

0 commit comments

Comments
 (0)