mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-12-25 10:17:38 +00:00
Fixed the dialog not being actually closed on click outside
Misplaced methods ftw
This commit is contained in:
parent
baf18a8762
commit
13262fdb18
@ -37,6 +37,7 @@ class MagiskDialog @JvmOverloads constructor(
|
|||||||
|
|
||||||
init {
|
init {
|
||||||
binding.setVariable(BR.data, data)
|
binding.setVariable(BR.data, data)
|
||||||
|
setCancelable(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
@ -57,10 +58,16 @@ class MagiskDialog @JvmOverloads constructor(
|
|||||||
)
|
)
|
||||||
insets
|
insets
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
binding.dialogBaseOutsideContainer.setOnClickListener {
|
override fun setCancelable(flag: Boolean) {
|
||||||
|
val listener = if (!flag) {
|
||||||
|
null
|
||||||
|
} else {
|
||||||
setCanceledOnTouchOutside(true)
|
setCanceledOnTouchOutside(true)
|
||||||
|
View.OnClickListener { dismiss() }
|
||||||
}
|
}
|
||||||
|
binding.dialogBaseOutsideContainer.setOnClickListener(listener)
|
||||||
}
|
}
|
||||||
|
|
||||||
inner class Data {
|
inner class Data {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user