diff --git a/README.md b/README.md index 7a0d25e..e43d2a3 100644 --- a/README.md +++ b/README.md @@ -22,8 +22,6 @@ Imagepicker plugin supporting both single and multiple selection. - [Request permissions, show the images list and process the selection](#request-permissions-show-the-images-list-and-process-the-selection) - [API](#api) - [Methods](#methods) - - [Properties](#properties) - - [Image properties](#image-properties) - [Contribute](#contribute) - [Get Help](#get-help) @@ -134,6 +132,7 @@ context | numberOfColumnsInPortrait | iOS | 4 | Set the number of columns in Portrait orientation. | | numberOfColumnsInLandscape | iOS | 7 | Set the number of columns in Landscape orientation. | | mediaType | both | Any | Choose whether to pick Image/Video/Any type of assets. | +| showAdvanced | Android | false | Show internal and removable storage options on Android (**WARNING**: [not supported officially](https://issuetracker.google.com/issues/72053350)). | The **hostView** parameter can be set to the view that hosts the image picker. Applicable in iOS only, intended to be used when open picker from a modal page. diff --git a/src/imagepicker.android.ts b/src/imagepicker.android.ts index 5037f76..4285b80 100644 --- a/src/imagepicker.android.ts +++ b/src/imagepicker.android.ts @@ -245,6 +245,10 @@ export class ImagePicker { intent.putExtra("android.intent.extra.ALLOW_MULTIPLE", true); } + if (this._options.showAdvanced) { + intent.putExtra("android.content.extra.SHOW_ADVANCED", true); + } + intent.putExtra(android.content.Intent.EXTRA_LOCAL_ONLY, true); intent.setAction("android.intent.action.OPEN_DOCUMENT"); let chooser = Intent.createChooser(intent, "Select Picture"); diff --git a/src/imagepicker.common.ts b/src/imagepicker.common.ts index 364787e..0d904f4 100644 --- a/src/imagepicker.common.ts +++ b/src/imagepicker.common.ts @@ -48,6 +48,12 @@ export interface Options { */ mediaType?: ImagePickerMediaType; + /** + * Show internal and removable storage options on Android. + * Not supported officially, see https://issuetracker.google.com/issues/72053350 | + */ + showAdvanced?: boolean; + android?: { /** * Provide a reason for permission request to access external storage on api levels above 23. diff --git a/src/index.d.ts b/src/index.d.ts index 38208e1..d28b76f 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -67,12 +67,19 @@ interface Options { */ mediaType?: ImagePickerMediaType; + /** + * Show internal and removable storage options on Android. + * Not supported officially, see https://issuetracker.google.com/issues/72053350 | + */ + showAdvanced?: boolean; + android?: { /** * Provide a reason for permission request to access external storage on api levels above 23. */ read_external_storage?: string; }; + } /**