From aea19ae6fe5132bc80fa176b0ccfd7eb78bd06be Mon Sep 17 00:00:00 2001 From: fisher Date: Thu, 4 Aug 2022 04:35:54 +0800 Subject: [PATCH] =?UTF-8?q?TXT=20=E7=9B=AE=E5=BD=95=E6=AD=A3=E5=88=99?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=A2=9E=E5=8A=A0=E6=A0=87=E9=A2=98=E7=A4=BA?= =?UTF-8?q?=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/legado/app/data/DatabaseMigrations.kt | 2 +- .../io/legado/app/data/entities/TxtTocRule.kt | 2 + .../ui/book/local/rule/TxtTocRuleActivity.kt | 4 +- .../ui/book/local/rule/TxtTocRuleAdapter.kt | 1 + .../main/res/layout/dialog_toc_regex_edit.xml | 13 +++ app/src/main/res/layout/item_txt_toc_rule.xml | 90 +++++++++++-------- app/src/main/res/values-es-rES/strings.xml | 1 + app/src/main/res/values-ja-rJP/strings.xml | 1 + app/src/main/res/values-pt-rBR/strings.xml | 1 + app/src/main/res/values-zh-rHK/strings.xml | 1 + app/src/main/res/values-zh-rTW/strings.xml | 1 + app/src/main/res/values-zh/strings.xml | 1 + app/src/main/res/values/strings.xml | 1 + 13 files changed, 78 insertions(+), 41 deletions(-) diff --git a/app/src/main/java/io/legado/app/data/DatabaseMigrations.kt b/app/src/main/java/io/legado/app/data/DatabaseMigrations.kt index 4fc5fce39..f315ad42d 100644 --- a/app/src/main/java/io/legado/app/data/DatabaseMigrations.kt +++ b/app/src/main/java/io/legado/app/data/DatabaseMigrations.kt @@ -48,7 +48,7 @@ object DatabaseMigrations { database.execSQL("DROP TABLE txtTocRules") database.execSQL( """CREATE TABLE txtTocRules(id INTEGER NOT NULL, - name TEXT NOT NULL, rule TEXT NOT NULL, serialNumber INTEGER NOT NULL, + name TEXT NOT NULL, rule TEXT NOT NULL,example TEXT DEFAULT NULL, serialNumber INTEGER NOT NULL, enable INTEGER NOT NULL, PRIMARY KEY (id))""" ) } diff --git a/app/src/main/java/io/legado/app/data/entities/TxtTocRule.kt b/app/src/main/java/io/legado/app/data/entities/TxtTocRule.kt index b4c28b0fb..1d37460f4 100644 --- a/app/src/main/java/io/legado/app/data/entities/TxtTocRule.kt +++ b/app/src/main/java/io/legado/app/data/entities/TxtTocRule.kt @@ -11,6 +11,7 @@ data class TxtTocRule( var id: Long = System.currentTimeMillis(), var name: String = "", var rule: String = "", + var example: String? = null, var serialNumber: Int = -1, var enable: Boolean = true ) { @@ -25,6 +26,7 @@ data class TxtTocRule( return id == other.id && name == other.name && rule == other.rule + && example == other.example && serialNumber == other.serialNumber && enable == other.enable } diff --git a/app/src/main/java/io/legado/app/ui/book/local/rule/TxtTocRuleActivity.kt b/app/src/main/java/io/legado/app/ui/book/local/rule/TxtTocRuleActivity.kt index 0eb4a00b6..26b85d603 100644 --- a/app/src/main/java/io/legado/app/ui/book/local/rule/TxtTocRuleActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/local/rule/TxtTocRuleActivity.kt @@ -97,12 +97,14 @@ class TxtTocRuleActivity : VMBaseActivity = aCache .getAsString(importTocRuleKey) ?.splitNotBlank(",") diff --git a/app/src/main/java/io/legado/app/ui/book/local/rule/TxtTocRuleAdapter.kt b/app/src/main/java/io/legado/app/ui/book/local/rule/TxtTocRuleAdapter.kt index a65fab48e..652ae5b94 100644 --- a/app/src/main/java/io/legado/app/ui/book/local/rule/TxtTocRuleAdapter.kt +++ b/app/src/main/java/io/legado/app/ui/book/local/rule/TxtTocRuleAdapter.kt @@ -45,6 +45,7 @@ class TxtTocRuleAdapter(context: Context, private val callBack: CallBack) : cbSource.text = item.name swtEnabled.isChecked = item.enable cbSource.isChecked = selected.contains(item) + titleExample.text = item.example } else { bundle.keySet().map { when (it) { diff --git a/app/src/main/res/layout/dialog_toc_regex_edit.xml b/app/src/main/res/layout/dialog_toc_regex_edit.xml index 52f152187..78b83be76 100644 --- a/app/src/main/res/layout/dialog_toc_regex_edit.xml +++ b/app/src/main/res/layout/dialog_toc_regex_edit.xml @@ -34,4 +34,17 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/item_txt_toc_rule.xml b/app/src/main/res/layout/item_txt_toc_rule.xml index 9db02db4e..fd969afcb 100644 --- a/app/src/main/res/layout/item_txt_toc_rule.xml +++ b/app/src/main/res/layout/item_txt_toc_rule.xml @@ -5,47 +5,59 @@ android:layout_height="wrap_content" android:background="?android:attr/selectableItemBackground" android:gravity="center_vertical" - android:orientation="horizontal" + android:orientation="vertical" android:padding="16dp"> - + + + + + + + + + + + + - - - - - - + android:textSize="12sp" /> \ No newline at end of file diff --git a/app/src/main/res/values-es-rES/strings.xml b/app/src/main/res/values-es-rES/strings.xml index da84ae19f..dfc6c3801 100644 --- a/app/src/main/res/values-es-rES/strings.xml +++ b/app/src/main/res/values-es-rES/strings.xml @@ -1006,4 +1006,5 @@ 滑动翻页阈值 滑动翻页阈值(0 = 系统默认值) 滑动多长距离才会触发滑动翻页(系统默认值 %s px) + Ejemplo diff --git a/app/src/main/res/values-ja-rJP/strings.xml b/app/src/main/res/values-ja-rJP/strings.xml index 5abffefef..7f345b5e3 100644 --- a/app/src/main/res/values-ja-rJP/strings.xml +++ b/app/src/main/res/values-ja-rJP/strings.xml @@ -1009,4 +1009,5 @@ 滑动翻页阈值 滑动翻页阈值(0 = 系统默认值) 滑动多长距离才会触发滑动翻页(系统默认值 %s px) + diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index c408ab7a6..4070c5c15 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -1009,4 +1009,5 @@ 滑动翻页阈值 滑动翻页阈值(0 = 系统默认值) 滑动多长距离才会触发滑动翻页(系统默认值 %s px) + Exemplo diff --git a/app/src/main/res/values-zh-rHK/strings.xml b/app/src/main/res/values-zh-rHK/strings.xml index 80a3df2fa..99a15125e 100644 --- a/app/src/main/res/values-zh-rHK/strings.xml +++ b/app/src/main/res/values-zh-rHK/strings.xml @@ -1006,4 +1006,5 @@ 滑动翻页阈值 滑动翻页阈值(0 = 系统默认值) 滑动多长距离才会触发滑动翻页(系统默认值 %s px) + 示例 diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index b6375b7bb..928a00828 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -1008,4 +1008,5 @@ 滑动翻页阈值 滑动翻页阈值(0 = 系统默认值) 滑动多长距离才会触发滑动翻页(系统默认值 %s px) + 示例 diff --git a/app/src/main/res/values-zh/strings.xml b/app/src/main/res/values-zh/strings.xml index 58bc32cf2..e395e543c 100644 --- a/app/src/main/res/values-zh/strings.xml +++ b/app/src/main/res/values-zh/strings.xml @@ -1008,4 +1008,5 @@ 滑动翻页阈值 滑动翻页阈值(0 = 系统默认值) 滑动多长距离才会触发滑动翻页(系统默认值 %s px) + 示例 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 1be2b90dd..3b1824116 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -660,6 +660,7 @@ Import default rules Name Regex + Example More menu Minus Plus