feat: 优化代码

pull/133/head
kunfei 5 years ago
parent 6528d3633c
commit 4088cc720b
  1. 6
      app/src/main/java/io/legado/app/ui/book/read/page/delegate/PageDelegate.kt

@ -191,7 +191,9 @@ abstract class PageDelegate(protected val pageView: PageView) :
if (isStarted) return if (isStarted) return
if (!detector.onTouchEvent(event)) { if (!detector.onTouchEvent(event)) {
//GestureDetector.onFling小幅移动不会触发,所以要自己判断 //GestureDetector.onFling小幅移动不会触发,所以要自己判断
if (event.action == MotionEvent.ACTION_UP && isMoved) { when (event.action) {
MotionEvent.ACTION_UP,
MotionEvent.ACTION_CANCEL -> if (isMoved) {
if (selectedOnDown) { if (selectedOnDown) {
selectedOnDown = false selectedOnDown = false
} }
@ -199,6 +201,7 @@ abstract class PageDelegate(protected val pageView: PageView) :
} }
} }
} }
}
/** /**
* 按下 * 按下
@ -233,6 +236,7 @@ abstract class PageDelegate(protected val pageView: PageView) :
return true return true
} }
if (isMoved) { if (isMoved) {
if (!noNext) onAnimStart()
return true return true
} }
val x = e.x val x = e.x

Loading…
Cancel
Save