Merge pull request #26 from gedoor/master

up
pull/379/head
口口吕 5 years ago committed by GitHub
commit 7a4ee0a02b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      app/src/main/java/io/legado/app/ui/book/read/page/delegate/HorizontalPageDelegate.kt
  2. 11
      app/src/main/java/io/legado/app/ui/book/read/page/delegate/NoAnimPageDelegate.kt
  3. 2
      app/src/main/java/io/legado/app/ui/book/read/page/delegate/PageDelegate.kt

@ -93,7 +93,7 @@ abstract class HorizontalPageDelegate(pageView: PageView) : PageDelegate(pageVie
}
}
if (isMoved) {
isCancel = if (mDirection == Direction.NEXT) touchX > lastX else touchX < lastX
isCancel = if (mDirection == Direction.NEXT) sumX > lastX else sumX < lastX
isRunning = true
//设置触摸点
setTouchPoint(sumX, sumY)

@ -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