File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
android/src/main/java/com/reactnative/ivpusic/imagepicker Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -104,6 +104,8 @@ class PickerModule extends ReactContextBaseJavaModule implements ActivityEventLi
104
104
private int width = 0 ;
105
105
private int height = 0 ;
106
106
107
+ private int maxFiles = 5 ;
108
+
107
109
private Uri mCameraCaptureURI ;
108
110
private String mCurrentMediaPath ;
109
111
private ResultCollector resultCollector = new ResultCollector ();
@@ -135,6 +137,7 @@ private void setConfiguration(final ReadableMap options) {
135
137
includeExif = options .hasKey ("includeExif" ) && options .getBoolean ("includeExif" );
136
138
width = options .hasKey ("width" ) ? options .getInt ("width" ) : 0 ;
137
139
height = options .hasKey ("height" ) ? options .getInt ("height" ) : 0 ;
140
+ maxFiles = options .hasKey ("maxFiles" ) ? options .getInt ("maxFiles" ) : 0 ;
138
141
cropping = options .hasKey ("cropping" ) && options .getBoolean ("cropping" );
139
142
cropperActiveWidgetColor = options .hasKey ("cropperActiveWidgetColor" ) ? options .getString ("cropperActiveWidgetColor" ) : null ;
140
143
cropperStatusBarColor = options .hasKey ("cropperStatusBarColor" ) ? options .getString ("cropperStatusBarColor" ) : null ;
@@ -381,7 +384,7 @@ private void initiatePicker(final Activity activity) {
381
384
382
385
Intent intent ;
383
386
if (multiple ) {
384
- intent = new ActivityResultContracts .PickMultipleVisualMedia ().createIntent (activity , builder .build ());
387
+ intent = new ActivityResultContracts .PickMultipleVisualMedia (maxFiles ).createIntent (activity , builder .build ());
385
388
} else {
386
389
intent = new ActivityResultContracts .PickVisualMedia ().createIntent (activity , builder .build ());
387
390
}
You can’t perform that action at this time.
0 commit comments