mirror of
https://github.com/gedoor/legado.git
synced 2024-07-04 23:36:56 +08:00
优化
This commit is contained in:
parent
f3f10a6c47
commit
1840645b0d
|
@ -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)
|
||||
|
|
|
@ -60,6 +60,9 @@ data class TextLine(
|
|||
if (field != value) {
|
||||
invalidate()
|
||||
}
|
||||
if (value) {
|
||||
textPage.hasReadAloudSpan = true
|
||||
}
|
||||
field = value
|
||||
}
|
||||
var textPage: TextPage = emptyTextPage
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user