From 9111d9a43ccc22513d1e57bd7ebf42f7c9eca720 Mon Sep 17 00:00:00 2001 From: fisher Date: Wed, 17 Aug 2022 18:30:06 +0800 Subject: [PATCH] =?UTF-8?q?=E9=98=85=E8=AF=BB=E7=95=8C=E9=9D=A2=E7=9A=84TX?= =?UTF-8?q?T=E7=9B=AE=E5=BD=95=E6=AD=A3=E5=88=99=20=E5=BC=B9=E6=A1=86?= =?UTF-8?q?=E4=B8=AD=E4=B9=9F=E6=94=AF=E6=8C=81=E6=AD=A3=E5=88=99=E6=A0=87?= =?UTF-8?q?=E9=A2=98=E7=A4=BA=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/ui/book/read/config/TocRegexDialog.kt | 3 + app/src/main/res/layout/item_toc_regex.xml | 90 +++++++++++-------- 2 files changed, 54 insertions(+), 39 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/book/read/config/TocRegexDialog.kt b/app/src/main/java/io/legado/app/ui/book/read/config/TocRegexDialog.kt index 371914b7c..36ae41686 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/config/TocRegexDialog.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/config/TocRegexDialog.kt @@ -169,12 +169,14 @@ class TocRegexDialog() : BaseDialogFragment(R.layout.dialog_toc_regex), alertBinding.apply { tvRuleName.setText(tocRule.name) tvRuleRegex.setText(tocRule.rule) + tvRuleExample.setText(tocRule.example) } customView { alertBinding.root } okButton { alertBinding.apply { tocRule.name = tvRuleName.text.toString() tocRule.rule = tvRuleRegex.text.toString() + tocRule.example = tvRuleExample.text.toString() viewModel.saveRule(tocRule) } } @@ -200,6 +202,7 @@ class TocRegexDialog() : BaseDialogFragment(R.layout.dialog_toc_regex), if (payloads.isEmpty()) { root.setBackgroundColor(context.backgroundColor) rbRegexName.text = item.name + titleExample.text = item.example rbRegexName.isChecked = item.name == selectedName swtEnabled.isChecked = item.enable } else { diff --git a/app/src/main/res/layout/item_toc_regex.xml b/app/src/main/res/layout/item_toc_regex.xml index 93496c4b8..7b1be37f3 100644 --- a/app/src/main/res/layout/item_toc_regex.xml +++ b/app/src/main/res/layout/item_toc_regex.xml @@ -1,47 +1,59 @@ - - + android:background="?android:attr/selectableItemBackground" + android:gravity="center_vertical" + android:orientation="vertical" + android:padding="16dp"> + + + - + - + - + + + + \ No newline at end of file