Commit 13262fdb authored by Viktor De Pasquale's avatar Viktor De Pasquale

Fixed the dialog not being actually closed on click outside

Misplaced methods ftw
parent baf18a87
......@@ -37,6 +37,7 @@ class MagiskDialog @JvmOverloads constructor(
init {
binding.setVariable(BR.data, data)
setCancelable(true)
}
override fun onCreate(savedInstanceState: Bundle?) {
......@@ -57,10 +58,16 @@ class MagiskDialog @JvmOverloads constructor(
)
insets
}
}
binding.dialogBaseOutsideContainer.setOnClickListener {
override fun setCancelable(flag: Boolean) {
val listener = if (!flag) {
null
} else {
setCanceledOnTouchOutside(true)
View.OnClickListener { dismiss() }
}
binding.dialogBaseOutsideContainer.setOnClickListener(listener)
}
inner class Data {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment