File tree Expand file tree Collapse file tree
indicator-fast-scroll/src/main/java/com/reddit/indicatorfastscroll Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -301,7 +301,7 @@ class FastScrollerView @JvmOverloads constructor(
301301 override fun onTouchEvent (event : MotionEvent ): Boolean {
302302 fun View.containsY (y : Int ) = y in (top until bottom)
303303
304- if (event.action == MotionEvent . ACTION_UP ) {
304+ if (event.action in MOTIONEVENT_STOP_ACTIONS ) {
305305 isPressed = false
306306 lastSelectedPosition = null
307307 onItemIndicatorTouched?.invoke(false )
@@ -347,6 +347,11 @@ class FastScrollerView @JvmOverloads constructor(
347347
348348 companion object {
349349
350+ private val MOTIONEVENT_STOP_ACTIONS = intArrayOf(
351+ MotionEvent .ACTION_UP ,
352+ MotionEvent .ACTION_CANCEL
353+ )
354+
350355 private fun FastScrollerView.createAdapterDataObserver (): RecyclerView .AdapterDataObserver {
351356 return object : RecyclerView .AdapterDataObserver () {
352357 override fun onChanged () {
You can’t perform that action at this time.
0 commit comments