pull/736/head
gedoor 5 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 autoPageProgress += scrollOffset
if (autoPageProgress >= binding.readView.height) { if (autoPageProgress >= binding.readView.height) {
autoPageProgress = 0 autoPageProgress = 0
binding.readView.fillPage(PageDirection.NEXT) if (!binding.readView.fillPage(PageDirection.NEXT)) {
autoPageStop()
}
} else { } else {
binding.readView.invalidate() binding.readView.invalidate()
} }

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

Loading…
Cancel
Save