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 -> {
val index = event.findPointerIndex(mScrollPointerId)
if (index < 0) {
return false
}
val y = (event.getY(index) + 0.5f).toInt()
var dy = mLastTouchY - y
if (mScrollState != scrollStateDragging) {
var startScroll = false
if (abs(dy) > mTouchSlop) {
if (dy > 0) {
dy -= mTouchSlop
} else {
dy += mTouchSlop
if (index > 0) {
val y = (event.getY(index) + 0.5f).toInt()
var dy = mLastTouchY - y
if (mScrollState != scrollStateDragging) {
var startScroll = false
if (abs(dy) > mTouchSlop) {
if (dy > 0) {
dy -= mTouchSlop
} else {
dy += mTouchSlop
}
startScroll = true
}
if (startScroll) {
setScrollState(scrollStateDragging)
}
startScroll = true
}
if (startScroll) {
setScrollState(scrollStateDragging)
}
}
if (mScrollState == scrollStateDragging) {
mLastTouchY = y
if (mScrollState == scrollStateDragging) {
mLastTouchY = y
}
}
}
MotionEvent.ACTION_POINTER_UP -> {

Loading…
Cancel
Save