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

[BUG] - AlertDialog can always be cancelled, which leads to a black CropActivity #334

Closed
xvlaze opened this issue Mar 16, 2022 · 3 comments · Fixed by #343
Closed

[BUG] - AlertDialog can always be cancelled, which leads to a black CropActivity #334

xvlaze opened this issue Mar 16, 2022 · 3 comments · Fixed by #343

Comments

@xvlaze
Copy link

xvlaze commented Mar 16, 2022

  • Lib Version 4.1.0

Describe the bug
When extending CropImageActivity, the AlertDialog is cancellable if touched outside. If the user accidentally touches outside the dialog, it is left into a black CropImageActivity and the dialog never comes back. If trying to override the method after my CropImageActivity extension's onCreate:

override fun showImageSourceDialog(openSource: (Source) -> Unit) {
        AlertDialog.Builder(this)
            .setTitle("sample title")
            .setCancellable(false) // Does not work :(
            .setItems(
                arrayOf(
                    getString(R.string.pick_image_camera),
                    getString(R.string.pick_image_gallery),
                )
            ) { _, position -> openSource(if (position == 0) Source.CAMERA else Source.GALLERY) }
            .show()
    }

...no custom title is assigned, plus the dialog is still cancellable even after told otherwise. The debugger never enters this method.

To Reproduce
Steps to reproduce the behavior:

  1. Create a new CropImageActivity just as shown in the documentation.
  2. Touch outside the dialog once it appears.

Expected behavior
The dialog should not be cancelled on touch outside.

Media
Please add screenshots and/or screen recordings to help explain your problem.
We cannot help without more information

Smartphone (please complete the following information):

  • Device: Huawei P40 Pro, Nexus 5 (emulated).
  • OS: Android 10, Android 12 respectively.
@Canato
Copy link
Member

Canato commented Mar 18, 2022

Indeed, good spot. Will work on listen to dismiss action when I have time,

Free to any one jump in and fix this

@RemiMabsout
Copy link
Contributor

Can i work on it ?

@Canato
Copy link
Member

Canato commented Mar 28, 2022

Yes @RemiMabsout please =D

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

Successfully merging a pull request may close this issue.

3 participants