Skip to content

Commit

Permalink
Merge pull request #170 from maskaravivek/minSdk
Browse files Browse the repository at this point in the history
Minor change to support SDK 15 and above
  • Loading branch information
jkwiecien committed Mar 28, 2019
2 parents 54978a1 + a7eca07 commit 46d6f60
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ buildscript {
ext {
compile_sdk_version = 28
target_sdk_version = 28
min_sdk_version = 16
min_sdk_version = 15
version_code = 12
version_name = "2.1.0"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,11 @@ public static void handleActivityResult(int requestCode, int resultCode, Intent
}

private static boolean isPhoto(Intent data) {
return data == null || (data.getData() == null && data.getClipData() == null);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
return data == null || (data.getData() == null && data.getClipData() == null);
} else {
return data == null || (data.getData() == null);
}
}

public static boolean willHandleActivityResult(int requestCode, int resultCode, Intent data) {
Expand Down Expand Up @@ -420,8 +424,11 @@ private static void onPictureReturnedFromDocuments(Intent data, Activity activit

private static void onPictureReturnedFromGallery(Intent data, Activity activity, @NonNull Callbacks callbacks) {
try {
ClipData clipData = data.getClipData();
List<File> files = new ArrayList<>();
ClipData clipData = null;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
clipData = data.getClipData();
}
if (clipData == null) {
Uri uri = data.getData();
File file = EasyImageFiles.pickedExistingPicture(activity, uri);
Expand Down

0 comments on commit 46d6f60

Please sign in to comment.