list: keep the swipe underlay visible through the spring-back

This commit is contained in:
jay
2026-11-12 16:50:07 -05:00
parent 037c5b1382
commit 7efa7bff59
@@ -123,7 +123,8 @@ class SwipeActionsCallback(
} else { } else {
dX dX
} }
if (actionState == ItemTouchHelper.ACTION_STATE_SWIPE && isCurrentlyActive) { if (actionState == ItemTouchHelper.ACTION_STATE_SWIPE) {
if (isCurrentlyActive) {
// Arm when the finger passes the cell; disarm when pulled back inside it. // Arm when the finger passes the cell; disarm when pulled back inside it.
val raw = abs(dX) val raw = abs(dX)
val reveal = revealWidth(viewHolder).toFloat() val reveal = revealWidth(viewHolder).toFloat()
@@ -134,6 +135,8 @@ class SwipeActionsCallback(
armedViewHolder = null armedViewHolder = null
armedAction = null armedAction = null
} }
}
// Draw whenever the row is displaced, including the spring-back's frames.
if (clampedDX != 0f) { if (clampedDX != 0f) {
drawUnderlay(c, viewHolder, clampedDX) drawUnderlay(c, viewHolder, clampedDX)
} }