Skip to content

Commit

Permalink
fix #1074: make add/edit dialogs cancellable
Browse files Browse the repository at this point in the history
  • Loading branch information
hussainmohd-a committed Sep 28, 2023
1 parent 83046ea commit e06d0e9
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,6 @@ class CustomDomainAdapter(val context: Context, val rule: CustomRulesActivity.RU
lp.height = WindowManager.LayoutParams.WRAP_CONTENT
dialog.show()
dialog.setCancelable(true)
dialog.setCanceledOnTouchOutside(true)
dialog.window?.attributes = lp

dBind.dacdUrlTitle.text = context.getString(R.string.cd_dialog_title)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -717,8 +717,7 @@ class CustomIpAdapter(private val context: Context, private val type: CustomRule
lp.width = WindowManager.LayoutParams.MATCH_PARENT
lp.height = WindowManager.LayoutParams.WRAP_CONTENT
dialog.show()
dialog.setCancelable(false)
dialog.setCanceledOnTouchOutside(false)
dialog.setCancelable(true)
dialog.window?.attributes = lp

dBind.daciIpTitle.text = context.getString(R.string.ci_dialog_title)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,7 @@ class CustomDomainFragment :
lp.width = WindowManager.LayoutParams.MATCH_PARENT
lp.height = WindowManager.LayoutParams.WRAP_CONTENT
dialog.show()
dialog.setCancelable(false)
dialog.setCanceledOnTouchOutside(false)
dialog.setCancelable(true)
dialog.window?.attributes = lp

dBind.dacdUrlTitle.text = getString(R.string.cd_dialog_title)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,7 @@ class CustomIpFragment : Fragment(R.layout.fragment_custom_ip), SearchView.OnQue
lp.width = WindowManager.LayoutParams.MATCH_PARENT
lp.height = WindowManager.LayoutParams.WRAP_CONTENT
dialog.show()
dialog.setCancelable(false)
dialog.setCanceledOnTouchOutside(false)
dialog.setCancelable(true)
dialog.window?.attributes = lp

dBind.daciIpTitle.text = getString(R.string.ci_dialog_title)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,7 @@ class DnsCryptListFragment : Fragment(R.layout.fragment_dns_crypt_list) {
lp.width = WindowManager.LayoutParams.MATCH_PARENT
lp.height = WindowManager.LayoutParams.WRAP_CONTENT
dialog.show()
dialog.setCancelable(false)
dialog.setCanceledOnTouchOutside(false)
dialog.setCancelable(true)
dialog.window?.attributes = lp

val radioServer = dialogBinding.dialogDnsCryptRadioServer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,7 @@ class DnsProxyListFragment : Fragment(R.layout.fragment_dns_proxy_list) {
lp.width = WindowManager.LayoutParams.MATCH_PARENT
lp.height = WindowManager.LayoutParams.WRAP_CONTENT
dialog.show()
dialog.setCancelable(false)
dialog.setCanceledOnTouchOutside(false)
dialog.setCancelable(true)

// TODO: figure out why window maybe null
dialog.window?.attributes = lp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,7 @@ class DoTListFragment : Fragment(R.layout.fragment_dot_list) {
lp.width = WindowManager.LayoutParams.MATCH_PARENT
lp.height = WindowManager.LayoutParams.WRAP_CONTENT
dialog.show()
dialog.setCancelable(false)
dialog.setCanceledOnTouchOutside(false)
dialog.setCancelable(true)
dialog.window?.attributes = lp

val heading = dialogBinding.dialogCustomUrlTop
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@ class DohListFragment : Fragment(R.layout.fragment_doh_list) {
lp.width = WindowManager.LayoutParams.MATCH_PARENT
lp.height = WindowManager.LayoutParams.WRAP_CONTENT
dialog.show()
dialog.setCancelable(false)
dialog.setCanceledOnTouchOutside(false)
dialog.setCancelable(true)
dialog.window?.attributes = lp

val applyURLBtn = dialogBinding.dialogCustomUrlOkBtn
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,7 @@ class ODoHListFragment : Fragment(R.layout.fragment_odoh_list) {
lp.width = WindowManager.LayoutParams.MATCH_PARENT
lp.height = WindowManager.LayoutParams.WRAP_CONTENT
dialog.show()
dialog.setCancelable(false)
dialog.setCanceledOnTouchOutside(false)
dialog.setCancelable(true)
dialog.window?.attributes = lp

val heading = dialogBinding.dialogCustomUrlTop
Expand Down

0 comments on commit e06d0e9

Please sign in to comment.