pull/2277/head
kunfei 2 years ago
parent 64a8026bbf
commit 514f080236
  1. 1
      app/src/main/java/io/legado/app/help/config/ReadBookConfig.kt
  2. 10
      app/src/main/java/io/legado/app/ui/book/read/page/provider/ChapterProvider.kt

@ -210,6 +210,7 @@ object ReadBookConfig {
config.paragraphSpacing = value config.paragraphSpacing = value
} }
//标题位置 0:居左 1:居中 2:隐藏
var titleMode: Int var titleMode: Int
get() = config.titleMode get() = config.titleMode
set(value) { set(value) {

@ -124,11 +124,10 @@ object ChapterProvider {
var durY = 0f var durY = 0f
textPages.add(TextPage()) textPages.add(TextPage())
if (ReadBookConfig.titleMode != 2) { if (ReadBookConfig.titleMode != 2) {
//标题非隐藏
displayTitle.splitNotBlank("\n").forEach { text -> displayTitle.splitNotBlank("\n").forEach { text ->
setTypeText( setTypeText(
book, book, absStartX, durY,
absStartX,
durY,
if (AppConfig.enableReview) text + reviewChar else text, if (AppConfig.enableReview) text + reviewChar else text,
textPages, textPages,
stringBuilder, stringBuilder,
@ -145,6 +144,7 @@ object ChapterProvider {
} }
contents.forEach { content -> contents.forEach { content ->
if (book.getImageStyle().equals(Book.imgStyleText, true)) { if (book.getImageStyle().equals(Book.imgStyleText, true)) {
//图片样式为文字嵌入类型
var text = content.replace(srcReplaceChar, "") var text = content.replace(srcReplaceChar, "")
val srcList = LinkedList<String>() val srcList = LinkedList<String>()
val sb = StringBuffer() val sb = StringBuffer()
@ -187,9 +187,7 @@ object ChapterProvider {
val text = content.substring(start, content.length) val text = content.substring(start, content.length)
if (text.isNotBlank()) { if (text.isNotBlank()) {
setTypeText( setTypeText(
book, book, absStartX, durY,
absStartX,
durY,
if (AppConfig.enableReview) text + reviewChar else text, if (AppConfig.enableReview) text + reviewChar else text,
textPages, textPages,
stringBuilder, stringBuilder,

Loading…
Cancel
Save