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
104104 private int width = 0 ;
105105 private int height = 0 ;
106106
107+ private int maxFiles = 5 ;
108+
107109 private Uri mCameraCaptureURI ;
108110 private String mCurrentMediaPath ;
109111 private ResultCollector resultCollector = new ResultCollector ();
@@ -135,6 +137,7 @@ private void setConfiguration(final ReadableMap options) {
135137 includeExif = options .hasKey ("includeExif" ) && options .getBoolean ("includeExif" );
136138 width = options .hasKey ("width" ) ? options .getInt ("width" ) : 0 ;
137139 height = options .hasKey ("height" ) ? options .getInt ("height" ) : 0 ;
140+ maxFiles = options .hasKey ("maxFiles" ) ? options .getInt ("maxFiles" ) : 0 ;
138141 cropping = options .hasKey ("cropping" ) && options .getBoolean ("cropping" );
139142 cropperActiveWidgetColor = options .hasKey ("cropperActiveWidgetColor" ) ? options .getString ("cropperActiveWidgetColor" ) : null ;
140143 cropperStatusBarColor = options .hasKey ("cropperStatusBarColor" ) ? options .getString ("cropperStatusBarColor" ) : null ;
@@ -381,7 +384,7 @@ private void initiatePicker(final Activity activity) {
381384
382385 Intent intent ;
383386 if (multiple ) {
384- intent = new ActivityResultContracts .PickMultipleVisualMedia ().createIntent (activity , builder .build ());
387+ intent = new ActivityResultContracts .PickMultipleVisualMedia (maxFiles ).createIntent (activity , builder .build ());
385388 } else {
386389 intent = new ActivityResultContracts .PickVisualMedia ().createIntent (activity , builder .build ());
387390 }
You can’t perform that action at this time.
0 commit comments