This commit is contained in:
Horis 2024-03-11 20:34:25 +08:00
parent f3f10a6c47
commit 1840645b0d
3 changed files with 9 additions and 1 deletions

View File

@ -201,7 +201,7 @@ object ReadBook : CoroutineScope by MainScope() {
val nextPagePos = it.getNextPageLength(durChapterPos)
if (nextPagePos >= 0) {
hasNextPage = true
curTextChapter?.getPage(durPageIndex)?.removePageAloudSpan()
it.getPage(durPageIndex)?.removePageAloudSpan()
durChapterPos = nextPagePos
callBack?.upContent()
saveRead(true)

View File

@ -60,6 +60,9 @@ data class TextLine(
if (field != value) {
invalidate()
}
if (value) {
textPage.hasReadAloudSpan = true
}
field = value
}
var textPage: TextPage = emptyTextPage

View File

@ -50,6 +50,7 @@ data class TextPage(
var doublePage = false
var paddingTop = ChapterProvider.paddingTop
var isCompleted = false
var hasReadAloudSpan = false
@JvmField
var textChapter = emptyTextChapter
@ -178,6 +179,10 @@ data class TextPage(
* 移除朗读标志
*/
fun removePageAloudSpan(): TextPage {
if (!hasReadAloudSpan) {
return this
}
hasReadAloudSpan = false
for (i in textLines.indices) {
textLines[i].isReadAloud = false
}