Skip to content

Commit

Permalink
Applying code review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
KenCorbettTruepic committed Jan 23, 2024
1 parent e9c8a1d commit c479627
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -275,10 +275,14 @@ public void onActivityResult(int requestCode, int resultCode, Intent intent) {
Uri[] result = null;
if (resultCode == Activity.RESULT_OK) {
List<Uri> uris = new ArrayList<Uri>();
if (intent == null && captureUri != null) { // camera

if (intent != null && intent.getData() != null) { // single file
LOG.v(LOG_TAG, "Adding file (single): " + intent.getData());
uris.add(intent.getData());
} else if (captureUri != null) { // camera
LOG.v(LOG_TAG, "Adding camera capture: " + captureUri);
uris.add(captureUri);
} else if (intent.getClipData() != null) { // multiple files
} else if (intent != null && intent.getClipData() != null) { // multiple files
ClipData clipData = intent.getClipData();
int count = clipData.getItemCount();
for (int i = 0; i < count; i++) {
Expand All @@ -288,10 +292,6 @@ public void onActivityResult(int requestCode, int resultCode, Intent intent) {
uris.add(uri);
}
}

} else if (intent.getData() != null) { // single file
LOG.v(LOG_TAG, "Adding file (single): " + intent.getData());
uris.add(intent.getData());
}

if (!uris.isEmpty()) {
Expand Down

0 comments on commit c479627

Please sign in to comment.