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..7bd50acd7 100644
--- a/app/src/main/res/layout/item_toc_regex.xml
+++ b/app/src/main/res/layout/item_toc_regex.xml
@@ -3,45 +3,56 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:padding="8dp"
+ android:padding="16dp"
android:gravity="center_vertical"
- android:orientation="horizontal">
+ android:orientation="vertical">
-
+
+
+
+
-
+
-
+
+
-
+
\ No newline at end of file