Closed oakware-lda closed 5 years ago
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?
Oh sorry, I probably didn't explain correctly. Please check this example:
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!
Understood now! That is a valid suggestion, I will add it soon :) Thanks!
Thanks to @ikakus this will be added to next version.
Implemented in 1.1.0
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()?