Skip to content

Commit 5ac9aa7

Browse files
authored
Merge pull request #302 from xuhcc/sd-card
feat(android): add option for showing internal/external storage
2 parents 853a74f + 73d16d0 commit 5ac9aa7

File tree

4 files changed

+18
-2
lines changed

4 files changed

+18
-2
lines changed

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ Imagepicker plugin supporting both single and multiple selection.
2222
- [Request permissions, show the images list and process the selection](#request-permissions-show-the-images-list-and-process-the-selection)
2323
- [API](#api)
2424
- [Methods](#methods)
25-
- [Properties](#properties)
26-
- [Image properties](#image-properties)
2725
- [Contribute](#contribute)
2826
- [Get Help](#get-help)
2927

@@ -134,6 +132,7 @@ context
134132
| numberOfColumnsInPortrait | iOS | 4 | Set the number of columns in Portrait orientation. |
135133
| numberOfColumnsInLandscape | iOS | 7 | Set the number of columns in Landscape orientation. |
136134
| mediaType | both | Any | Choose whether to pick Image/Video/Any type of assets. |
135+
| showAdvanced | Android | false | Show internal and removable storage options on Android (**WARNING**: [not supported officially](https://issuetracker.google.com/issues/72053350)). |
137136

138137
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.
139138

src/imagepicker.android.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,10 @@ export class ImagePicker {
245245
intent.putExtra("android.intent.extra.ALLOW_MULTIPLE", true);
246246
}
247247

248+
if (this._options.showAdvanced) {
249+
intent.putExtra("android.content.extra.SHOW_ADVANCED", true);
250+
}
251+
248252
intent.putExtra(android.content.Intent.EXTRA_LOCAL_ONLY, true);
249253
intent.setAction("android.intent.action.OPEN_DOCUMENT");
250254
let chooser = Intent.createChooser(intent, "Select Picture");

src/imagepicker.common.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ export interface Options {
4848
*/
4949
mediaType?: ImagePickerMediaType;
5050

51+
/**
52+
* Show internal and removable storage options on Android.
53+
* Not supported officially, see https://issuetracker.google.com/issues/72053350 |
54+
*/
55+
showAdvanced?: boolean;
56+
5157
android?: {
5258
/**
5359
* Provide a reason for permission request to access external storage on api levels above 23.

src/index.d.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,19 @@ interface Options {
6767
*/
6868
mediaType?: ImagePickerMediaType;
6969

70+
/**
71+
* Show internal and removable storage options on Android.
72+
* Not supported officially, see https://issuetracker.google.com/issues/72053350 |
73+
*/
74+
showAdvanced?: boolean;
75+
7076
android?: {
7177
/**
7278
* Provide a reason for permission request to access external storage on api levels above 23.
7379
*/
7480
read_external_storage?: string;
7581
};
82+
7683
}
7784

7885
/**

0 commit comments

Comments
 (0)