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