This commit is contained in:
gedoor 2021-10-05 14:36:32 +08:00
parent ce76bf5d81
commit c9d2fdde10

View File

@ -291,8 +291,17 @@ class DragSelectTouchHelper(
updateSelectedRange(rv, e)
}
}
MotionEvent.ACTION_CANCEL, MotionEvent.ACTION_UP -> selectFinished(mEnd)
else -> {
MotionEvent.ACTION_CANCEL, MotionEvent.ACTION_UP -> {
if (mSlideStateStartPosition != RecyclerView.NO_POSITION) {
selectFirstItem(mSlideStateStartPosition)
// selection is triggered
mSlideStateStartPosition = RecyclerView.NO_POSITION
Logger.i("onTouchEvent: after slide mode down")
}
if (!mIsInTopHotspot && !mIsInBottomHotspot) {
updateSelectedRange(rv, e)
}
selectFinished(mEnd)
}
}
}