@hotta/react-native-imagepicker 0.2.3 → 0.2.5
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.
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
package com.htreactnative.imagepicker
|
|
2
2
|
|
|
3
|
+
import android.content.pm.ActivityInfo
|
|
3
4
|
import android.graphics.BitmapFactory
|
|
4
5
|
import android.graphics.Color
|
|
5
6
|
import com.facebook.react.bridge.Promise
|
|
@@ -40,6 +41,7 @@ class NativeImagePickerModule(reactContext: ReactApplicationContext) :
|
|
|
40
41
|
pickerOptions = options;
|
|
41
42
|
PictureSelector.create(reactApplicationContext.currentActivity)
|
|
42
43
|
.openGallery(SelectMimeType.ofImage())
|
|
44
|
+
.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT)
|
|
43
45
|
.setImageEngine(imageEngine)
|
|
44
46
|
.forResult(object : OnResultCallbackListener<LocalMedia> {
|
|
45
47
|
override fun onResult(localMediaList: ArrayList<LocalMedia?>?) {
|
|
@@ -66,9 +68,11 @@ class NativeImagePickerModule(reactContext: ReactApplicationContext) :
|
|
|
66
68
|
val isCamera = options?.getBoolean("isCamera") ?: false
|
|
67
69
|
PictureSelector.create(reactApplicationContext.currentActivity)
|
|
68
70
|
.openGallery(SelectMimeType.ofVideo())
|
|
71
|
+
.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT)
|
|
69
72
|
.setSelectionMode(SelectModeConfig.SINGLE)
|
|
70
73
|
.setMaxSelectNum(1)
|
|
71
74
|
.isDisplayCamera(isCamera)
|
|
75
|
+
.isAutoVideoPlay(true)
|
|
72
76
|
.setSelectorUIStyle(getNoCountStyle())
|
|
73
77
|
.setInjectLayoutResourceListener { _, resourceSource ->
|
|
74
78
|
when (resourceSource) {
|
package/lib/module/index.js
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import NativeImagePicker
|
|
3
|
+
import NativeImagePicker from "./NativeImagePicker.js";
|
|
4
4
|
const HTNativeImagePicker = (() => {
|
|
5
5
|
return {
|
|
6
|
-
asyncShowImagePicker:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
},
|
|
13
|
-
asyncShowVideoPicker: options => {
|
|
6
|
+
asyncShowImagePicker: NativeImagePicker.asyncShowImagePicker,
|
|
7
|
+
asyncShowVideoPicker: NativeImagePicker.asyncShowVideoPicker
|
|
8
|
+
};
|
|
9
|
+
})();
|
|
10
|
+
export default HTNativeImagePicker;
|
|
11
|
+
//# sourceMappingURL=index.js.map asyncShowVideoPicker: options => {
|
|
14
12
|
const _options = {
|
|
15
13
|
...defaultOptions,
|
|
16
14
|
...options
|