@hotta/react-native-imagepicker 0.2.5 → 0.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -39,9 +39,16 @@ class NativeImagePickerModule(reactContext: ReactApplicationContext) :
39
39
  promise: Promise?
40
40
  ) {
41
41
  pickerOptions = options;
42
+ val imageCount = options?.getInt("imageCount") ?: 1
43
+ val isCamera = options?.getBoolean("isCamera") ?: false
42
44
  PictureSelector.create(reactApplicationContext.currentActivity)
43
45
  .openGallery(SelectMimeType.ofImage())
44
46
  .setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT)
47
+ .setSelectionMode(
48
+ if (imageCount > 1) SelectModeConfig.MULTIPLE else SelectModeConfig.SINGLE
49
+ )
50
+ .setMaxSelectNum(imageCount)
51
+ .isDisplayCamera(isCamera)
45
52
  .setImageEngine(imageEngine)
46
53
  .forResult(object : OnResultCallbackListener<LocalMedia> {
47
54
  override fun onResult(localMediaList: ArrayList<LocalMedia?>?) {
@@ -1,14 +1,16 @@
1
1
  "use strict";
2
2
 
3
- import NativeImagePicker from "./NativeImagePicker.js";
3
+ import NativeImagePicker, { defaultOptions } from "./NativeImagePicker.js";
4
4
  const HTNativeImagePicker = (() => {
5
5
  return {
6
- asyncShowImagePicker: NativeImagePicker.asyncShowImagePicker,
7
- asyncShowVideoPicker: NativeImagePicker.asyncShowVideoPicker
8
- };
9
- })();
10
- export default HTNativeImagePicker;
11
- //# sourceMappingURL=index.js.map asyncShowVideoPicker: options => {
6
+ asyncShowImagePicker: options => {
7
+ const _options = {
8
+ ...defaultOptions,
9
+ ...options
10
+ };
11
+ return NativeImagePicker.asyncShowImagePicker(_options);
12
+ },
13
+ asyncShowVideoPicker: options => {
12
14
  const _options = {
13
15
  ...defaultOptions,
14
16
  ...options
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hotta/react-native-imagepicker",
3
- "version": "0.2.5",
3
+ "version": "0.2.6",
4
4
  "description": "@hotta/react-native-imagepicker",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",