Mark view when swipe starts so ItemAnimator doesn't interfere
This commit is contained in:
parent
23b68555fb
commit
30a2126fcb
1 changed files with 3 additions and 3 deletions
|
@ -69,6 +69,9 @@ class MessageListSwipeCallback(
|
|||
}
|
||||
|
||||
override fun onSwipeStarted(viewHolder: ViewHolder, direction: Int) {
|
||||
// Mark view to prevent MessageListItemAnimator from interfering with swipe animations
|
||||
viewHolder.markAsSwiped(true)
|
||||
|
||||
val swipeAction = when (direction) {
|
||||
ItemTouchHelper.RIGHT -> swipeRightAction
|
||||
ItemTouchHelper.LEFT -> swipeLeftAction
|
||||
|
@ -91,9 +94,6 @@ class MessageListSwipeCallback(
|
|||
override fun onSwiped(viewHolder: ViewHolder, direction: Int) {
|
||||
val item = viewHolder.messageListItem
|
||||
|
||||
// Mark view to prevent MessageListItemAnimator from interfering with swipe animations
|
||||
viewHolder.markAsSwiped(true)
|
||||
|
||||
when (direction) {
|
||||
ItemTouchHelper.RIGHT -> listener.onSwipeAction(item, swipeRightAction)
|
||||
ItemTouchHelper.LEFT -> listener.onSwipeAction(item, swipeLeftAction)
|
||||
|
|
Loading…
Reference in a new issue