|
|
@ -169,12 +169,14 @@ class TocRegexDialog() : BaseDialogFragment(R.layout.dialog_toc_regex), |
|
|
|
alertBinding.apply { |
|
|
|
alertBinding.apply { |
|
|
|
tvRuleName.setText(tocRule.name) |
|
|
|
tvRuleName.setText(tocRule.name) |
|
|
|
tvRuleRegex.setText(tocRule.rule) |
|
|
|
tvRuleRegex.setText(tocRule.rule) |
|
|
|
|
|
|
|
tvRuleExample.setText(tocRule.example) |
|
|
|
} |
|
|
|
} |
|
|
|
customView { alertBinding.root } |
|
|
|
customView { alertBinding.root } |
|
|
|
okButton { |
|
|
|
okButton { |
|
|
|
alertBinding.apply { |
|
|
|
alertBinding.apply { |
|
|
|
tocRule.name = tvRuleName.text.toString() |
|
|
|
tocRule.name = tvRuleName.text.toString() |
|
|
|
tocRule.rule = tvRuleRegex.text.toString() |
|
|
|
tocRule.rule = tvRuleRegex.text.toString() |
|
|
|
|
|
|
|
tocRule.example = tvRuleExample.text.toString() |
|
|
|
viewModel.saveRule(tocRule) |
|
|
|
viewModel.saveRule(tocRule) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -200,6 +202,7 @@ class TocRegexDialog() : BaseDialogFragment(R.layout.dialog_toc_regex), |
|
|
|
if (payloads.isEmpty()) { |
|
|
|
if (payloads.isEmpty()) { |
|
|
|
root.setBackgroundColor(context.backgroundColor) |
|
|
|
root.setBackgroundColor(context.backgroundColor) |
|
|
|
rbRegexName.text = item.name |
|
|
|
rbRegexName.text = item.name |
|
|
|
|
|
|
|
titleExample.text = item.example |
|
|
|
rbRegexName.isChecked = item.name == selectedName |
|
|
|
rbRegexName.isChecked = item.name == selectedName |
|
|
|
swtEnabled.isChecked = item.enable |
|
|
|
swtEnabled.isChecked = item.enable |
|
|
|
} else { |
|
|
|
} else { |
|
|
|