feat: 优化代码

pull/141/head
kunfei 5 years ago
parent 6fb51b0eea
commit 805cc907e2
  1. 11
      app/src/main/java/io/legado/app/ui/book/read/page/delegate/NoAnimPageDelegate.kt
  2. 2
      app/src/main/java/io/legado/app/ui/book/read/page/delegate/PageDelegate.kt

@ -1,19 +1,14 @@
package io.legado.app.ui.book.read.page.delegate
import android.graphics.Canvas
import io.legado.app.ui.book.read.page.PageView
class NoAnimPageDelegate(pageView: PageView) : HorizontalPageDelegate(pageView) {
override fun onAnimStart() {
startScroll(touchX.toInt(), 0, 0, 0)
}
override fun onDraw(canvas: Canvas) {
}
override fun onAnimStop() {
override fun onAnimStart() {
if (!isCancel) {
pageView.fillPage(mDirection)
}
stopScroll()
}
}

@ -126,7 +126,7 @@ abstract class PageDelegate(protected val pageView: PageView) :
pageView.invalidate()
}
private fun stopScroll() {
protected fun stopScroll() {
isStarted = false
pageView.post {
isMoved = false

Loading…
Cancel
Save