mirror of
https://github.com/gedoor/legado.git
synced 2025-08-10 00:52:30 +00:00
优化
This commit is contained in:
@@ -292,8 +292,10 @@ abstract class BaseReadAloudService : BaseService(),
|
||||
readAloudNumber -= contentList[nowSpeak].length + 1 + paragraphStartPos
|
||||
paragraphStartPos = 0
|
||||
textChapter?.let {
|
||||
val paragraphs = it.getParagraphs(readAloudByPage)
|
||||
if (!paragraphs[nowSpeak].isParagraphEnd) readAloudNumber++
|
||||
if (readAloudByPage) {
|
||||
val paragraphs = it.getParagraphs(true)
|
||||
if (!paragraphs[nowSpeak].isParagraphEnd) readAloudNumber++
|
||||
}
|
||||
if (readAloudNumber < it.getReadLength(pageIndex)) {
|
||||
pageIndex--
|
||||
ReadBook.moveToPrevPage()
|
||||
@@ -314,8 +316,10 @@ abstract class BaseReadAloudService : BaseService(),
|
||||
paragraphStartPos = 0
|
||||
nowSpeak++
|
||||
textChapter?.let {
|
||||
val paragraphs = it.getParagraphs(readAloudByPage)
|
||||
if (!paragraphs[nowSpeak].isParagraphEnd) readAloudNumber--
|
||||
if (readAloudByPage) {
|
||||
val paragraphs = it.getParagraphs(true)
|
||||
if (!paragraphs[nowSpeak].isParagraphEnd) readAloudNumber--
|
||||
}
|
||||
if (readAloudNumber >= it.getReadLength(pageIndex + 1)) {
|
||||
pageIndex++
|
||||
ReadBook.moveToNextPage()
|
||||
|
||||
Reference in New Issue
Block a user