From e09c0c47fa1f77b265101339e0015e2659ef2c70 Mon Sep 17 00:00:00 2001 From: gedoor Date: Wed, 29 Jul 2020 10:43:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/io/legado/app/service/help/ReadBook.kt | 4 +++- .../main/java/io/legado/app/ui/book/read/ReadBookActivity.kt | 4 ++++ .../main/java/io/legado/app/ui/book/read/page/PageView.kt | 5 ++++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/io/legado/app/service/help/ReadBook.kt b/app/src/main/java/io/legado/app/service/help/ReadBook.kt index 7878cb1c2..8f5c74f4e 100644 --- a/app/src/main/java/io/legado/app/service/help/ReadBook.kt +++ b/app/src/main/java/io/legado/app/service/help/ReadBook.kt @@ -64,6 +64,7 @@ object ReadBook { null } } + callBack?.upPageAnim() } fun upMsg(msg: String?) { @@ -356,7 +357,7 @@ object ReadBook { } } - private val imageStyle get() = webBook?.bookSource?.ruleContent?.imageStyle + val imageStyle get() = webBook?.bookSource?.ruleContent?.imageStyle fun saveRead() { Coroutine.async { @@ -378,5 +379,6 @@ object ReadBook { fun upView() fun pageChanged() fun contentLoadFinish() + fun upPageAnim() } } \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt b/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt index 38bd04b42..3d2cc808a 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt @@ -550,6 +550,10 @@ class ReadBookActivity : VMBaseActivity(R.layout.activity_boo } } + override fun upPageAnim() { + page_view?.upPageAnim() + } + /** * 页面改变 */ 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 efad055aa..63e90d0fe 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 @@ -17,6 +17,7 @@ import io.legado.app.ui.book.read.page.provider.ChapterProvider import io.legado.app.utils.activity import io.legado.app.utils.screenshot import kotlinx.android.synthetic.main.activity_book_read.view.* +import java.util.* class PageView(context: Context, attrs: AttributeSet) : FrameLayout(context, attrs), @@ -109,7 +110,9 @@ class PageView(context: Context, attrs: AttributeSet) : fun upPageAnim() { pageDelegate?.onDestroy() pageDelegate = null - pageDelegate = when (ReadBookConfig.pageAnim) { + pageDelegate = if (ReadBook.imageStyle?.toUpperCase(Locale.ROOT) == "FULL") { + ScrollPageDelegate(this) + } else when (ReadBookConfig.pageAnim) { 0 -> CoverPageDelegate(this) 1 -> SlidePageDelegate(this) 2 -> SimulationPageDelegate(this)