mirror of
https://github.com/gedoor/legado.git
synced 2025-08-10 00:52:30 +00:00
优化
This commit is contained in:
@@ -358,7 +358,9 @@ abstract class BaseReadAloudService : BaseService(),
|
||||
val paragraphs = it.getParagraphs(true)
|
||||
if (!paragraphs[nowSpeak].isParagraphEnd) readAloudNumber--
|
||||
}
|
||||
if (readAloudNumber >= it.getReadLength(pageIndex + 1)) {
|
||||
if (pageIndex + 1 < it.pageSize
|
||||
&& readAloudNumber >= it.getReadLength(pageIndex + 1)
|
||||
) {
|
||||
pageIndex++
|
||||
ReadBook.moveToNextPage()
|
||||
}
|
||||
|
||||
@@ -477,12 +477,12 @@ class HttpReadAloudService : BaseReadAloudService(),
|
||||
val sleep = exoPlayer.duration / speakTextLength
|
||||
val start = speakTextLength * exoPlayer.currentPosition / exoPlayer.duration
|
||||
for (i in start..contentList[nowSpeak].length) {
|
||||
if (readAloudNumber + i > textChapter.getReadLength(pageIndex + 1)) {
|
||||
if (pageIndex + 1 < textChapter.pageSize
|
||||
&& readAloudNumber + i > textChapter.getReadLength(pageIndex + 1)
|
||||
) {
|
||||
pageIndex++
|
||||
if (pageIndex < textChapter.pageSize) {
|
||||
ReadBook.moveToNextPage()
|
||||
upTtsProgress(readAloudNumber + i.toInt())
|
||||
}
|
||||
ReadBook.moveToNextPage()
|
||||
upTtsProgress(readAloudNumber + i.toInt())
|
||||
}
|
||||
delay(sleep)
|
||||
}
|
||||
|
||||
@@ -195,7 +195,9 @@ class TTSReadAloudService : BaseReadAloudService(), TextToSpeech.OnInitListener
|
||||
if (contentList[nowSpeak].matches(AppPattern.notReadAloudRegex)) {
|
||||
nextParagraph()
|
||||
}
|
||||
if (readAloudNumber + 1 > it.getReadLength(pageIndex + 1)) {
|
||||
if (pageIndex + 1 < it.pageSize
|
||||
&& readAloudNumber + 1 > it.getReadLength(pageIndex + 1)
|
||||
) {
|
||||
pageIndex++
|
||||
ReadBook.moveToNextPage()
|
||||
}
|
||||
@@ -214,7 +216,9 @@ class TTSReadAloudService : BaseReadAloudService(), TextToSpeech.OnInitListener
|
||||
"onRangeStart nowSpeak:$nowSpeak pageIndex:$pageIndex utteranceId:$utteranceId start:$start end:$end frame:$frame"
|
||||
LogUtils.d(TAG, msg)
|
||||
textChapter?.let {
|
||||
if (readAloudNumber + start > it.getReadLength(pageIndex + 1)) {
|
||||
if (pageIndex + 1 < it.pageSize
|
||||
&& readAloudNumber + start > it.getReadLength(pageIndex + 1)
|
||||
) {
|
||||
pageIndex++
|
||||
ReadBook.moveToNextPage()
|
||||
upTtsProgress(readAloudNumber + start)
|
||||
|
||||
@@ -1220,5 +1220,5 @@
|
||||
<string name="manga_epaper_stting">墨水屏设置</string>
|
||||
<string name="manga_epaper_value">阈值</string>
|
||||
<string name="disable_horizontal_animation">禁用水平滚动动画</string>
|
||||
<string name="enable_manga_gray">开启图片灰色</string>灰色
|
||||
<string name="enable_manga_gray">开启图片灰色</string>
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user