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

@ -66,27 +66,24 @@ 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 -> {
it.moveToPrevious() pageFactory?.moveToPrevious()
upContent() upContent()
if (isScrollDelegate()) {
curPage?.scrollToBottom()
}
} }
PageDelegate.Direction.NEXT -> { PageDelegate.Direction.NEXT -> {
it.moveToNext() pageFactory?.moveToNext()
upContent() upContent()
} if (isScrollDelegate()) {
else -> Unit curPage?.scrollTo(0)
} }
} }
if (isScrollDelegate()) {
when (direction) {
PageDelegate.Direction.PREV -> curPage?.scrollToBottom()
PageDelegate.Direction.NEXT -> curPage?.scrollTo(0)
else -> Unit else -> Unit
} }
} }
}
fun upPageAnim() { fun upPageAnim() {
pageDelegate = null pageDelegate = null

Loading…
Cancel
Save