限制源编辑框的最大行数,滚动到其他输入框更容易

pull/2343/head
kunfei 2 years ago
parent e8b4046277
commit 9c7a109ae5
  1. 6
      app/src/main/java/io/legado/app/ui/widget/text/ScrollMultiAutoCompleteTextView.kt

@ -36,7 +36,7 @@ open class ScrollMultiAutoCompleteTextView @JvmOverloads constructor(
override fun dispatchTouchEvent(event: MotionEvent): Boolean {
if (event.action == MotionEvent.ACTION_DOWN) {
//如果是新的按下事件,则对mBottomFlag重新初始化
mBottomFlag = mOffsetHeight <= 0
mBottomFlag = false
}
return super.dispatchTouchEvent(event)
}
@ -45,7 +45,9 @@ open class ScrollMultiAutoCompleteTextView @JvmOverloads constructor(
override fun onTouchEvent(event: MotionEvent): Boolean {
val result = super.onTouchEvent(event)
//如果是需要拦截,则再拦截,这个方法会在onScrollChanged方法之后再调用一次
if (!mBottomFlag) parent.requestDisallowInterceptTouchEvent(true)
if (!mBottomFlag) {
parent.requestDisallowInterceptTouchEvent(true)
}
return result
}

Loading…
Cancel
Save