From e38e8168d9fac0e225f89ab35ca4c5b20bf1ad26 Mon Sep 17 00:00:00 2001 From: kunfei Date: Fri, 20 Sep 2019 16:34:04 +0800 Subject: [PATCH] up --- .../io/legado/app/ui/widget/page/PageView.kt | 10 ++++----- .../page/delegate/ScrollPageDelegate.kt | 21 +++++++++++++++++++ 2 files changed, 25 insertions(+), 6 deletions(-) create mode 100644 app/src/main/java/io/legado/app/ui/widget/page/delegate/ScrollPageDelegate.kt diff --git a/app/src/main/java/io/legado/app/ui/widget/page/PageView.kt b/app/src/main/java/io/legado/app/ui/widget/page/PageView.kt index e64df6781..689eae713 100644 --- a/app/src/main/java/io/legado/app/ui/widget/page/PageView.kt +++ b/app/src/main/java/io/legado/app/ui/widget/page/PageView.kt @@ -7,10 +7,7 @@ import android.util.AttributeSet import android.view.MotionEvent import android.widget.FrameLayout import io.legado.app.help.ReadBookConfig -import io.legado.app.ui.widget.page.delegate.CoverPageDelegate -import io.legado.app.ui.widget.page.delegate.NoAnimPageDelegate -import io.legado.app.ui.widget.page.delegate.PageDelegate -import io.legado.app.ui.widget.page.delegate.SlidePageDelegate +import io.legado.app.ui.widget.page.delegate.* import io.legado.app.utils.activity import io.legado.app.utils.getPrefInt @@ -140,9 +137,10 @@ class PageView(context: Context, attrs: AttributeSet) : FrameLayout(context, att fun upPageAnim() { pageDelegate = when (context.getPrefInt("pageAnim")) { + 0 -> CoverPageDelegate(this) 1 -> SlidePageDelegate(this) - 2 -> NoAnimPageDelegate(this) - else -> CoverPageDelegate(this) + 2 -> ScrollPageDelegate(this) + else -> NoAnimPageDelegate(this) } } diff --git a/app/src/main/java/io/legado/app/ui/widget/page/delegate/ScrollPageDelegate.kt b/app/src/main/java/io/legado/app/ui/widget/page/delegate/ScrollPageDelegate.kt new file mode 100644 index 000000000..2da678320 --- /dev/null +++ b/app/src/main/java/io/legado/app/ui/widget/page/delegate/ScrollPageDelegate.kt @@ -0,0 +1,21 @@ +package io.legado.app.ui.widget.page.delegate + +import android.graphics.Canvas +import io.legado.app.ui.widget.page.PageView + +class ScrollPageDelegate(pageView: PageView) : PageDelegate(pageView) { + + override fun onScrollStart() { + + } + + override fun onDraw(canvas: Canvas) { + + } + + override fun onScrollStop() { + + } + + +} \ No newline at end of file