franmontiel / franmontiel/FullScreenDialog

OnConfirmListener and OnDiscardListener are ignored

Open
#11 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
111
Forks
28
PR merge metrics
No merged PRs in 30d

Description

I just downloaded the library and tried to create a basic dialog.

I used the following code (it is in Kotlin):

```
var dialog: FullScreenDialogFragment? = null

val onDiscardListener = FullScreenDialogFragment.OnDiscardListener { dialog?.dismiss() }
val onConfirmListener = FullScreenDialogFragment.OnConfirmListener {
LogMessage("Confirm")
dialog?.dismiss()
}
dialog = FullScreenDialogFragment.Builder(this@MainActivity)
.setTitle(R.string.my_dialog_title)
.setConfirmButton(R.string.dialog_save_button)
.setOnConfirmListener(onConfirmListener)
.setOnDiscardListener(onDiscardListener)
.setContent(TestFragment::class.java, null)
.build()
dialog.show(supportFragmentManager, null)
```

The dialog shows up, but it doesn't matter if I click the `X` or `Save` buttons, they are ignored. I also tried to add it to the `MainActivity` with interface implementation, the result is the same. I can locse the dialog only by the `Back` button.

What should I try?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.