From 1125d60d3acd1d0bf45db5f8416b45789d6b1bd5 Mon Sep 17 00:00:00 2001 From: Xwite <1797350009@qq.com> Date: Wed, 9 Feb 2022 14:15:21 +0800 Subject: [PATCH 1/2] =?UTF-8?q?ChapterProvider.kt=E5=87=8F=E5=B0=91?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../book/read/page/provider/ChapterProvider.kt | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/provider/ChapterProvider.kt b/app/src/main/java/io/legado/app/ui/book/read/page/provider/ChapterProvider.kt index 4b6359a0b..0cca0ba86 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/provider/ChapterProvider.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/provider/ChapterProvider.kt @@ -114,6 +114,10 @@ object ChapterProvider { var durY = 0f textPages.add(TextPage()) contents.forEachIndexed { index, content -> + val isTitle = index == 0 + val isTitleWithNoContent = isTitle && contents.size == 1 + val isVolumeTitle = isTitle && bookChapter.isVolume + val textPaint = if (isTitle) titlePaint else contentPaint if (book.getImageStyle() == Book.imgStyleText) { var text = content.replace(srcReplaceChar, "▣") val srcList = LinkedList() @@ -128,10 +132,6 @@ object ChapterProvider { } matcher.appendTail(sb) text = sb.toString() - val isTitle = index == 0 - val isTitleWithNoContent = isTitle && contents.size == 1 - val isVolumeTitle = isTitle && bookChapter.isVolume - val textPaint = if (isTitle) titlePaint else contentPaint if (!(isTitle && ReadBookConfig.titleMode == 2)) { setTypeText( absStartX, durY, text, textPages, stringBuilder, @@ -147,10 +147,6 @@ object ChapterProvider { while (matcher.find()) { val text = content.substring(start, matcher.start()) if (text.isNotBlank()) { - val isTitle = index == 0 - val isTitleWithNoContent = isTitle && contents.size == 1 - val isVolumeTitle = isTitle && bookChapter.isVolume - val textPaint = if (isTitle) titlePaint else contentPaint if (!(isTitle && ReadBookConfig.titleMode == 2)) { setTypeText( absStartX, durY, text, textPages, stringBuilder, @@ -170,10 +166,6 @@ object ChapterProvider { if (start < content.length) { val text = content.substring(start, content.length) if (text.isNotBlank()) { - val isTitle = index == 0 - val isTitleWithNoContent = isTitle && contents.size == 1 - val isVolumeTitle = isTitle && bookChapter.isVolume - val textPaint = if (isTitle) titlePaint else contentPaint if (!(isTitle && ReadBookConfig.titleMode == 2)) { setTypeText( absStartX, durY, text, textPages, stringBuilder, From b830d5988cfef6ad0c5374fe2ed7bb8769070577 Mon Sep 17 00:00:00 2001 From: Xwite <1797350009@qq.com> Date: Thu, 10 Feb 2022 09:39:11 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=A0=A1=E9=AA=8C=E8=B6=85=E6=97=B6?= =?UTF-8?q?=E4=B8=8D=E5=86=8D=E9=99=90=E5=88=B6=E6=9C=80=E5=B0=8F=E5=80=BC?= =?UTF-8?q?=EF=BC=8C=E5=8F=AA=E8=83=BD=E8=BE=93=E5=85=A5=E6=95=B0=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/legado/app/ui/config/CheckSourceConfig.kt | 4 ++-- app/src/main/res/layout/dialog_check_source_config.xml | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/config/CheckSourceConfig.kt b/app/src/main/java/io/legado/app/ui/config/CheckSourceConfig.kt index c0a884081..9dfa80aac 100644 --- a/app/src/main/java/io/legado/app/ui/config/CheckSourceConfig.kt +++ b/app/src/main/java/io/legado/app/ui/config/CheckSourceConfig.kt @@ -19,7 +19,7 @@ class CheckSourceConfig : BaseDialogFragment(R.layout.dialog_check_source_config private val binding by viewBinding(DialogCheckSourceConfigBinding::bind) //允许的最小超时时间,秒 - private val minTimeout = 60L + private val minTimeout = 0L override fun onStart() { super.onStart() @@ -80,7 +80,7 @@ class CheckSourceConfig : BaseDialogFragment(R.layout.dialog_check_source_config toastOnUi("${getString(R.string.timeout)}${getString(R.string.cannot_empty)}") return@onClick } - text.toLong() < minTimeout -> { + text.toLong() <= minTimeout -> { toastOnUi( "${getString(R.string.timeout)}${getString(R.string.less_than)}${minTimeout}${ getString( diff --git a/app/src/main/res/layout/dialog_check_source_config.xml b/app/src/main/res/layout/dialog_check_source_config.xml index 5a6dd410d..0b43f38f1 100644 --- a/app/src/main/res/layout/dialog_check_source_config.xml +++ b/app/src/main/res/layout/dialog_check_source_config.xml @@ -27,6 +27,7 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:hint="@string/check_source_timeout" + android:digits="1234567890" tools:ignore="SpeakableTextPresentCheck,TouchTargetSizeCheck" />