Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ class FastScrollerView @JvmOverloads constructor(
override fun onTouchEvent(event: MotionEvent): Boolean {
fun View.containsY(y: Int) = y in (top until bottom)

if (event.action == MotionEvent.ACTION_UP) {
if (event.action in MOTIONEVENT_STOP_ACTIONS) {
isPressed = false
lastSelectedPosition = null
onItemIndicatorTouched?.invoke(false)
Expand Down Expand Up @@ -347,6 +347,11 @@ class FastScrollerView @JvmOverloads constructor(

companion object {

private val MOTIONEVENT_STOP_ACTIONS = intArrayOf(
MotionEvent.ACTION_UP,
MotionEvent.ACTION_CANCEL
)

private fun FastScrollerView.createAdapterDataObserver(): RecyclerView.AdapterDataObserver {
return object : RecyclerView.AdapterDataObserver() {
override fun onChanged() {
Expand Down