|
|
@ -65,7 +65,6 @@ abstract class PageDelegate(protected val pageView: PageView) { |
|
|
|
var isCancel = false |
|
|
|
var isCancel = false |
|
|
|
var isRunning = false |
|
|
|
var isRunning = false |
|
|
|
var isStarted = false |
|
|
|
var isStarted = false |
|
|
|
var isLongPress = false |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected fun setStartPoint(x: Float, y: Float, invalidate: Boolean = true) { |
|
|
|
protected fun setStartPoint(x: Float, y: Float, invalidate: Boolean = true) { |
|
|
|
startX = x |
|
|
|
startX = x |
|
|
@ -211,7 +210,6 @@ abstract class PageDelegate(protected val pageView: PageView) { |
|
|
|
private inner class GestureListener : GestureDetector.SimpleOnGestureListener() { |
|
|
|
private inner class GestureListener : GestureDetector.SimpleOnGestureListener() { |
|
|
|
|
|
|
|
|
|
|
|
override fun onDown(e: MotionEvent): Boolean { |
|
|
|
override fun onDown(e: MotionEvent): Boolean { |
|
|
|
isLongPress = false |
|
|
|
|
|
|
|
// abort() |
|
|
|
// abort() |
|
|
|
//是否移动 |
|
|
|
//是否移动 |
|
|
|
isMoved = false |
|
|
|
isMoved = false |
|
|
@ -259,11 +257,6 @@ abstract class PageDelegate(protected val pageView: PageView) { |
|
|
|
return true |
|
|
|
return true |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
override fun onLongPress(e: MotionEvent?) { |
|
|
|
|
|
|
|
curPage?.dispatchTouchEvent(e) |
|
|
|
|
|
|
|
isLongPress = true |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
override fun onScroll( |
|
|
|
override fun onScroll( |
|
|
|
e1: MotionEvent, |
|
|
|
e1: MotionEvent, |
|
|
|
e2: MotionEvent, |
|
|
|
e2: MotionEvent, |
|
|
@ -271,10 +264,14 @@ abstract class PageDelegate(protected val pageView: PageView) { |
|
|
|
distanceY: Float |
|
|
|
distanceY: Float |
|
|
|
): Boolean { |
|
|
|
): Boolean { |
|
|
|
curPage?.contentTextView()?.let { |
|
|
|
curPage?.contentTextView()?.let { |
|
|
|
|
|
|
|
//滑动时禁止选择文字 |
|
|
|
|
|
|
|
if (it.isTextSelectable) { |
|
|
|
it.setTextIsSelectable(false) |
|
|
|
it.setTextIsSelectable(false) |
|
|
|
it.movementMethod = scrollingMovementMethod |
|
|
|
it.movementMethod = scrollingMovementMethod |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
if (pageView.isScrollDelegate()) { |
|
|
|
if (pageView.isScrollDelegate()) { |
|
|
|
|
|
|
|
//传递触摸事件到textView |
|
|
|
curPage?.dispatchTouchEvent(e2) |
|
|
|
curPage?.dispatchTouchEvent(e2) |
|
|
|
return true |
|
|
|
return true |
|
|
|
} |
|
|
|
} |
|
|
|