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

After choosing an image, the list is dismissed #6

Closed
oakware-lda opened this issue Jun 14, 2018 · 5 comments
Closed

After choosing an image, the list is dismissed #6

oakware-lda opened this issue Jun 14, 2018 · 5 comments

Comments

@oakware-lda
Copy link

I am using the single image selection dialog and when I choose the image, the list just disappears. Any way to override the ActivityResult to ignore that dismiss()?

@siralam
Copy link
Owner

siralam commented Jun 15, 2018

Sorry I don't get what you mean, the list disappears when you select an image by design; and the library has nothing to do with onActivityResult. What are you trying to achieve?

@oakware-lda
Copy link
Author

Oh sorry, I probably didn't explain correctly. Please check this example:

ezgif com-video-to-gif

As you can see, I have a grid with two images and have the following BSImagePicker.OnSingleImageSelectedListener:

override fun onSingleImageSelected(uri: Uri) {
    startActivity(Intent(this, ImageActivity::class.java).putExtra("uri", uri))
    overridePendingTransition(R.anim.pull_right, R.anim.pull_right_semi)
}

So, when I choose the image I start another activity and pass the uri so I can use the image. The problem is that after this new activity, when I go back to the previous activity (the one with the grid), the grid with the two images doesn't exists anymore.

I am pretty sure that the problem is the "dismiss()" on line 396 of the BSImagePicker.java class:

adapter.setImageTileOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {
        if (v.getTag() != null && v.getTag() instanceof Uri && onSingleImageSelectedListener != null) {
            onSingleImageSelectedListener.onSingleImageSelected((Uri) v.getTag());
            dismiss();
         }
     }
});

I know this is the normal behaviour of the library, and probably this is not even an issue, but would be nice to not dismiss the picker after an image click. Maybe add another method to the Builder to .dismissAfterClick(false).

I hope that you understand my issue. Anyway, thank you for your hard work and for this library!

@siralam
Copy link
Owner

siralam commented Jun 15, 2018

Understood now! That is a valid suggestion, I will add it soon :) Thanks!

@siralam
Copy link
Owner

siralam commented Oct 24, 2018

Thanks to @ikakus this will be added to next version.

@siralam siralam added this to the 1.1.0 milestone Oct 24, 2018
@siralam
Copy link
Owner

siralam commented Nov 27, 2018

Implemented in 1.1.0

@siralam siralam closed this as completed Nov 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants