Skip to content

Commit

Permalink
优化
Browse files Browse the repository at this point in the history
  • Loading branch information
821938089 committed Sep 23, 2023
1 parent 0b82858 commit 937d842
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ class ReadBookActivity : BaseReadBookActivity(),
private val nextPageRunnable by lazy { Runnable { mouseWheelPage(PageDirection.NEXT) } }
private val prevPageRunnable by lazy { Runnable { mouseWheelPage(PageDirection.PREV) } }
private var bookChanged = false
private var pageChanged = false

//恢复跳转前进度对话框的交互结果
private var confirmRestoreProcess: Boolean? = null
Expand Down Expand Up @@ -833,6 +834,7 @@ class ReadBookActivity : BaseReadBookActivity(),
* 页面改变
*/
override fun pageChanged() {
pageChanged = true
lifecycleScope.launch {
autoPageProgress = 0
upSeekBarProgress()
Expand Down Expand Up @@ -1152,9 +1154,10 @@ class ReadBookActivity : BaseReadBookActivity(),

BaseReadAloudService.pause -> {
val scrollPageAnim = ReadBook.pageAnim() == 3
if (scrollPageAnim) {
if (scrollPageAnim && pageChanged) {
pageChanged = false
val startPos = binding.readView.getCurPagePosition()
ReadAloud.play(this, startPos = startPos)
ReadBook.readAloud(startPos = startPos)
} else {
ReadAloud.resume(this)
}
Expand Down

0 comments on commit 937d842

Please sign in to comment.