From ff59f66cdeb0af78ee211cf97035e27d8682063a Mon Sep 17 00:00:00 2001 From: 821938089 <821938089@qq.com> Date: Thu, 21 Jul 2022 12:09:04 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/legado/app/ui/book/read/page/entities/TextPage.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/entities/TextPage.kt b/app/src/main/java/io/legado/app/ui/book/read/page/entities/TextPage.kt index 9fdfe83a3..499cf9b9d 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/entities/TextPage.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/entities/TextPage.kt @@ -26,6 +26,7 @@ data class TextPage( val lineSize get() = textLines.size val charSize get() = text.length + var isMsgOrTitlePage: Boolean = false fun getLine(index: Int): TextLine { return textLines.getOrElse(index) { @@ -78,7 +79,9 @@ data class TextPage( @Suppress("DEPRECATION") fun format(): TextPage { - if (textLines.isEmpty() && ChapterProvider.viewWidth > 0) { + if (textLines.isEmpty()) isMsgOrTitlePage = true + if (isMsgOrTitlePage && ChapterProvider.viewWidth > 0) { + textLines.clear() val visibleWidth = ChapterProvider.visibleRight - ChapterProvider.paddingLeft val layout = StaticLayout( text, ChapterProvider.contentPaint, visibleWidth, From 4b2f9e6fbcc40d2b1aa70b280194ae80a7a472bd Mon Sep 17 00:00:00 2001 From: 821938089 <821938089@qq.com> Date: Thu, 21 Jul 2022 12:43:54 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/legado/app/ui/book/read/page/entities/TextPage.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/entities/TextPage.kt b/app/src/main/java/io/legado/app/ui/book/read/page/entities/TextPage.kt index 499cf9b9d..40b0b2d61 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/entities/TextPage.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/entities/TextPage.kt @@ -26,7 +26,7 @@ data class TextPage( val lineSize get() = textLines.size val charSize get() = text.length - var isMsgOrTitlePage: Boolean = false + var isMsgPage: Boolean = false fun getLine(index: Int): TextLine { return textLines.getOrElse(index) { @@ -79,8 +79,8 @@ data class TextPage( @Suppress("DEPRECATION") fun format(): TextPage { - if (textLines.isEmpty()) isMsgOrTitlePage = true - if (isMsgOrTitlePage && ChapterProvider.viewWidth > 0) { + if (textLines.isEmpty()) isMsgPage = true + if (isMsgPage && ChapterProvider.viewWidth > 0) { textLines.clear() val visibleWidth = ChapterProvider.visibleRight - ChapterProvider.paddingLeft val layout = StaticLayout(