mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-12-24 21:57:37 +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 {
|
||||
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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user