feat: 优化

pull/201/head
kunfei 5 years ago
parent 93541d8131
commit bf27baccd1
  1. 1
      app/src/main/java/io/legado/app/help/BookHelp.kt
  2. 8
      app/src/main/java/io/legado/app/service/BaseReadAloudService.kt

@ -243,5 +243,6 @@ object BookHelp {
}
return c
.replace("\\s*\\n+\\s*".toRegex(), "\n${ReadBookConfig.bodyIndent}")
.replace("[\\n\\s]+$".toRegex(), "") //移除尾部空行
}
}

@ -111,16 +111,12 @@ abstract class BaseReadAloudService : BaseService(),
if (getPrefBoolean(PreferKey.readAloudByPage)) {
for (index in pageIndex..textChapter.lastIndex()) {
textChapter.page(index)?.text?.split("\n")?.let {
if (it.isNotEmpty()) {
contentList.addAll(it)
}
contentList.addAll(it)
}
}
} else {
textChapter.getUnRead(pageIndex).split("\n").forEach {
if (it.isNotEmpty()) {
contentList.add(it)
}
contentList.add(it)
}
}
if (play) play()

Loading…
Cancel
Save