list: restore swipe recovery by dropping the payload rebind

This commit is contained in:
jay
2026-11-12 16:36:43 -05:00
parent 18332d8478
commit 9f2b8894df
@@ -99,9 +99,9 @@ class SwipeActionsCallback(
song,
if (direction == ItemTouchHelper.END) SwipeAction.QUEUE else SwipeAction.PLAY_NEXT,
)
// The row stays: rebind it in place, cancelling the swipe-out animation. The payload
// keeps the item animator from cross-fading the row.
recyclerView.adapter?.notifyItemChanged(position, PAYLOAD_SWIPE_COMMIT)
// The row stays: rebind it in place; the full rebind also tells the touch helper to
// cancel the swipe-away animation and recover the row.
recyclerView.adapter?.notifyItemChanged(position)
}
/**
@@ -214,8 +214,4 @@ class SwipeActionsCallback(
icon.draw(c)
}
private companion object {
/** Payload for the in-place rebind after a committed swipe; avoids the cross-fade. */
val PAYLOAD_SWIPE_COMMIT = Any()
}
}