Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cloud support (Android) #650

Merged
merged 4 commits into from
May 16, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ private void initiateCamera(Activity activity) {

private void initiatePicker(final Activity activity) {
try {
final Intent galleryIntent = new Intent(Intent.ACTION_PICK);
final Intent galleryIntent = new Intent(Intent.ACTION_GET_CONTENT);

if (cropping || mediaType.equals("photo")) {
galleryIntent.setType("image/*");
Expand All @@ -328,11 +328,10 @@ private void initiatePicker(final Activity activity) {
String[] mimetypes = {"image/*", "video/*"};
galleryIntent.putExtra(Intent.EXTRA_MIME_TYPES, mimetypes);
}

galleryIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
galleryIntent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, multiple);
galleryIntent.setAction(Intent.ACTION_GET_CONTENT);
galleryIntent.putExtra(Intent.EXTRA_LOCAL_ONLY, true);
galleryIntent.addCategory(Intent.CATEGORY_OPENABLE);

final Intent chooserIntent = Intent.createChooser(galleryIntent, "Pick an image");
activity.startActivityForResult(chooserIntent, IMAGE_PICKER_REQUEST);
Expand Down Expand Up @@ -492,7 +491,7 @@ public void invoke(Object... args) {
}).run();
}

private String resolveRealPath(Activity activity, Uri uri, boolean isCamera) {
private String resolveRealPath(Activity activity, Uri uri, boolean isCamera) throws IOException {
String path;

if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
Expand Down Expand Up @@ -748,4 +747,4 @@ private static WritableMap getCroppedRectMap(Intent data) {

return map;
}
}
}
Loading