From ff4721019c2cbc966a307c410d3cf23afb2a1e70 Mon Sep 17 00:00:00 2001 From: kunfei Date: Mon, 24 Feb 2020 08:59:37 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/legado/app/ui/book/read/page/PageView.kt | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/PageView.kt b/app/src/main/java/io/legado/app/ui/book/read/page/PageView.kt index a0c6c962a..d2cae1e92 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/PageView.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/PageView.kt @@ -101,14 +101,16 @@ class PageView(context: Context, attrs: AttributeSet) : } fun upContent(position: Int = 0) { - pageFactory.let { + if (isScrollDelegate) { + curPage.setContent(pageFactory.currentPage()) + } else { when (position) { - -1 -> prevPage.setContent(it.previousPage()) - 1 -> nextPage.setContent(it.nextPage()) + -1 -> prevPage.setContent(pageFactory.previousPage()) + 1 -> nextPage.setContent(pageFactory.nextPage()) else -> { - curPage.setContent(it.currentPage()) - nextPage.setContent(it.nextPage()) - prevPage.setContent(it.previousPage()) + curPage.setContent(pageFactory.currentPage()) + nextPage.setContent(pageFactory.nextPage()) + prevPage.setContent(pageFactory.previousPage()) } } }