pull/34/head
kunfei 5 years ago
parent acc1fef158
commit e38e8168d9
  1. 10
      app/src/main/java/io/legado/app/ui/widget/page/PageView.kt
  2. 21
      app/src/main/java/io/legado/app/ui/widget/page/delegate/ScrollPageDelegate.kt

@ -7,10 +7,7 @@ import android.util.AttributeSet
import android.view.MotionEvent import android.view.MotionEvent
import android.widget.FrameLayout import android.widget.FrameLayout
import io.legado.app.help.ReadBookConfig import io.legado.app.help.ReadBookConfig
import io.legado.app.ui.widget.page.delegate.CoverPageDelegate import io.legado.app.ui.widget.page.delegate.*
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.utils.activity import io.legado.app.utils.activity
import io.legado.app.utils.getPrefInt import io.legado.app.utils.getPrefInt
@ -140,9 +137,10 @@ class PageView(context: Context, attrs: AttributeSet) : FrameLayout(context, att
fun upPageAnim() { fun upPageAnim() {
pageDelegate = when (context.getPrefInt("pageAnim")) { pageDelegate = when (context.getPrefInt("pageAnim")) {
0 -> CoverPageDelegate(this)
1 -> SlidePageDelegate(this) 1 -> SlidePageDelegate(this)
2 -> NoAnimPageDelegate(this) 2 -> ScrollPageDelegate(this)
else -> CoverPageDelegate(this) else -> NoAnimPageDelegate(this)
} }
} }

@ -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() {
}
}
Loading…
Cancel
Save