diff --git a/app/src/main/java/io/legado/app/help/config/ReadBookConfig.kt b/app/src/main/java/io/legado/app/help/config/ReadBookConfig.kt index 4b500e078..d39c0504f 100644 --- a/app/src/main/java/io/legado/app/help/config/ReadBookConfig.kt +++ b/app/src/main/java/io/legado/app/help/config/ReadBookConfig.kt @@ -210,6 +210,7 @@ object ReadBookConfig { config.paragraphSpacing = value } + //标题位置 0:居左 1:居中 2:隐藏 var titleMode: Int get() = config.titleMode set(value) { 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 88e28ffa2..b915e555e 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 @@ -124,11 +124,10 @@ object ChapterProvider { var durY = 0f textPages.add(TextPage()) if (ReadBookConfig.titleMode != 2) { + //标题非隐藏 displayTitle.splitNotBlank("\n").forEach { text -> setTypeText( - book, - absStartX, - durY, + book, absStartX, durY, if (AppConfig.enableReview) text + reviewChar else text, textPages, stringBuilder, @@ -145,6 +144,7 @@ object ChapterProvider { } contents.forEach { content -> if (book.getImageStyle().equals(Book.imgStyleText, true)) { + //图片样式为文字嵌入类型 var text = content.replace(srcReplaceChar, "▣") val srcList = LinkedList() val sb = StringBuffer() @@ -187,9 +187,7 @@ object ChapterProvider { val text = content.substring(start, content.length) if (text.isNotBlank()) { setTypeText( - book, - absStartX, - durY, + book, absStartX, durY, if (AppConfig.enableReview) text + reviewChar else text, textPages, stringBuilder,