pull/34/head
kunfei 5 years ago
parent 92de51fdab
commit 3fe160100f
  1. 29
      app/src/main/java/io/legado/app/ui/widget/page/PageView.kt

@ -66,25 +66,22 @@ class PageView(context: Context, attrs: AttributeSet) :
} }
fun fillPage(direction: PageDelegate.Direction) { fun fillPage(direction: PageDelegate.Direction) {
pageFactory?.let { when (direction) {
when (direction) { PageDelegate.Direction.PREV -> {
PageDelegate.Direction.PREV -> { pageFactory?.moveToPrevious()
it.moveToPrevious() upContent()
upContent() if (isScrollDelegate()) {
} curPage?.scrollToBottom()
PageDelegate.Direction.NEXT -> {
it.moveToNext()
upContent()
} }
else -> Unit
} }
} PageDelegate.Direction.NEXT -> {
if (isScrollDelegate()) { pageFactory?.moveToNext()
when (direction) { upContent()
PageDelegate.Direction.PREV -> curPage?.scrollToBottom() if (isScrollDelegate()) {
PageDelegate.Direction.NEXT -> curPage?.scrollTo(0) curPage?.scrollTo(0)
else -> Unit }
} }
else -> Unit
} }
} }

Loading…
Cancel
Save