修复:转发规则编辑页面关闭自定义模板/正则替换时没有清空输入框

This commit is contained in:
pppscn 2022-06-13 15:58:55 +08:00
parent 82b552672f
commit f34bfa926f

View File

@ -191,10 +191,23 @@ class RulesEditFragment : BaseFragment<FragmentRulesEditBinding?>(), View.OnClic
}
override fun onCheckedChanged(buttonView: CompoundButton?, isChecked: Boolean) {
val visibility = if (isChecked) View.VISIBLE else View.GONE
when (buttonView?.id) {
R.id.sb_sms_template -> binding!!.layoutSmsTemplate.visibility = visibility
R.id.sb_regex_replace -> binding!!.layoutRegexReplace.visibility = visibility
R.id.sb_sms_template -> {
if (isChecked) {
binding!!.layoutSmsTemplate.visibility = View.VISIBLE
} else {
binding!!.layoutSmsTemplate.visibility = View.GONE
binding!!.etSmsTemplate.setText("")
}
}
R.id.sb_regex_replace -> {
if (isChecked) {
binding!!.layoutRegexReplace.visibility = View.VISIBLE
} else {
binding!!.layoutRegexReplace.visibility = View.GONE
binding!!.etRegexReplace.setText("")
}
}
else -> {}
}
}