pull/34/head
kunfei 5 years ago
parent 6561e3c7bd
commit 09bf55bcf4
  1. 12
      app/src/main/java/io/legado/app/ui/widget/page/ContentTextView.kt

@ -27,6 +27,7 @@ class ContentTextView : AppCompatTextView {
private val scrollStateDragging = 1
val scrollStateSettling = 2
private val mViewFling: ViewFling by lazy { ViewFling() }
private var velocityTracker: VelocityTracker? = null
private var mScrollState = scrollStateIdle
private var mScrollPointerId = -1
@ -34,7 +35,7 @@ class ContentTextView : AppCompatTextView {
private var mTouchSlop: Int = 0
private var mMinFlingVelocity: Int = 0
private var mMaxFlingVelocity: Int = 0
private val mViewFling = ViewFling()
//滑动距离的最大边界
private var mOffsetHeight: Int = 0
@ -80,13 +81,8 @@ class ContentTextView : AppCompatTextView {
initOffsetHeight()
}
override fun onTextChanged(
text: CharSequence,
start: Int,
lengthBefore: Int,
lengthAfter: Int
) {
super.onTextChanged(text, start, lengthBefore, lengthAfter)
override fun setText(text: CharSequence?, type: BufferType?) {
super.setText(text, type)
initOffsetHeight()
}

Loading…
Cancel
Save