pull/736/head
gedoor 4 years ago
parent 5b1ac7703e
commit 23acdff42e
  1. 4
      app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt
  2. 6
      app/src/main/java/io/legado/app/ui/book/read/page/ReadView.kt

@ -611,7 +611,9 @@ class ReadBookActivity : ReadBookBaseActivity(),
autoPageProgress += scrollOffset
if (autoPageProgress >= binding.readView.height) {
autoPageProgress = 0
binding.readView.fillPage(PageDirection.NEXT)
if (!binding.readView.fillPage(PageDirection.NEXT)) {
autoPageStop()
}
} else {
binding.readView.invalidate()
}

@ -437,15 +437,15 @@ class ReadView(context: Context, attrs: AttributeSet) :
curPage.cancelSelect()
}
fun fillPage(direction: PageDirection) {
when (direction) {
fun fillPage(direction: PageDirection): Boolean {
return when (direction) {
PageDirection.PREV -> {
pageFactory.moveToPrev(true)
}
PageDirection.NEXT -> {
pageFactory.moveToNext(true)
}
else -> Unit
else -> false
}
}

Loading…
Cancel
Save