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) {
pageFactory?.let {
when (direction) {
PageDelegate.Direction.PREV -> {
it.moveToPrevious()
upContent()
}
PageDelegate.Direction.NEXT -> {
it.moveToNext()
upContent()
when (direction) {
PageDelegate.Direction.PREV -> {
pageFactory?.moveToPrevious()
upContent()
if (isScrollDelegate()) {
curPage?.scrollToBottom()
}
else -> Unit
}
}
if (isScrollDelegate()) {
when (direction) {
PageDelegate.Direction.PREV -> curPage?.scrollToBottom()
PageDelegate.Direction.NEXT -> curPage?.scrollTo(0)
else -> Unit
PageDelegate.Direction.NEXT -> {
pageFactory?.moveToNext()
upContent()
if (isScrollDelegate()) {
curPage?.scrollTo(0)
}
}
else -> Unit
}
}

Loading…
Cancel
Save