pull/34/head
kunfei 5 years ago
parent 0c0d81c14b
commit c6b5ec21f2
  1. 42
      app/src/main/java/io/legado/app/ui/widget/page/ContentTextView.kt

@ -125,31 +125,29 @@ class ContentTextView : AppCompatTextView {
} }
MotionEvent.ACTION_MOVE -> { MotionEvent.ACTION_MOVE -> {
val index = event.findPointerIndex(mScrollPointerId) val index = event.findPointerIndex(mScrollPointerId)
if (index < 0) { if (index > 0) {
return false val y = (event.getY(index) + 0.5f).toInt()
} var dy = mLastTouchY - y
val y = (event.getY(index) + 0.5f).toInt() if (mScrollState != scrollStateDragging) {
var dy = mLastTouchY - y var startScroll = false
if (mScrollState != scrollStateDragging) { if (abs(dy) > mTouchSlop) {
var startScroll = false if (dy > 0) {
dy -= mTouchSlop
if (abs(dy) > mTouchSlop) { } else {
if (dy > 0) { dy += mTouchSlop
dy -= mTouchSlop }
} else { startScroll = true
dy += mTouchSlop }
if (startScroll) {
setScrollState(scrollStateDragging)
} }
startScroll = true
}
if (startScroll) {
setScrollState(scrollStateDragging)
} }
}
if (mScrollState == scrollStateDragging) { if (mScrollState == scrollStateDragging) {
mLastTouchY = y mLastTouchY = y
}
} }
} }
MotionEvent.ACTION_POINTER_UP -> { MotionEvent.ACTION_POINTER_UP -> {

Loading…
Cancel
Save