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

Multiple images selection #103

Open
BorisLaskov opened this issue Aug 12, 2019 · 1 comment
Open

Multiple images selection #103

BorisLaskov opened this issue Aug 12, 2019 · 1 comment

Comments

@BorisLaskov
Copy link

I am trying to select multiple images from the gallery.

RxPaparazzo
    .multiple(this)  // From a fragment
    .usingGallery()
    .subscribeOn(Schedulers.io())
    .observeOn(AndroidSchedulers.mainThread())
    .subscribe { response ->
        if (response.resultCode() != RESULT_OK) {
            return@subscribe
        }
        // handle response.data()
    }

It works fine for the files stored locally. Yet, when I choose Google Photos from the drawer menu, it allows me to select multiple pictures just fine but returns an array of just a single file.

I have done a little bit of debugging. I see that in PickFiles.java right in this place:

    Uri pickedUri = intent.getData();
    if (pickedUri != null) {
      PermissionUtil.grantReadPermissionToUri(targetUi, pickedUri);

      return Arrays.asList(pickedUri);
    } else {
      return getUris(intent);
    }

it takes only a single Uri from .getData() and proceeds without checking ClipData (which is done in the getUris(intent) method). It looks like this ClipData actually contains Uris for all selected files including the first one, which is duplicated inside whatever getData() returns.

If it allows me to select multiple images through GUI, I would expect it to return all of them instead of just one.

Tested on Nokia 7 plus and an emulator, both running Android 9.

@BorisLaskov
Copy link
Author

I've just realized that images that I pick through "Photos" are also stored locally... My point is: it simply works when I choose images from the default picker that appears first, but when I go to "Photos" through the drawer menu (where "Photos", Google Drive and potentially other apps reside) I encounter the bug described above. Sorry for confusion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant