From 7efa7bff59270992a43b464ef160f02fb2f83d47 Mon Sep 17 00:00:00 2001 From: Jay Date: Thu, 12 Nov 2026 16:50:07 -0500 Subject: [PATCH] list: keep the swipe underlay visible through the spring-back --- .../list/recycler/SwipeActionsCallback.kt | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/app/src/main/java/org/oxycblt/auxio/list/recycler/SwipeActionsCallback.kt b/app/src/main/java/org/oxycblt/auxio/list/recycler/SwipeActionsCallback.kt index 2006d2d8b..af14ea123 100644 --- a/app/src/main/java/org/oxycblt/auxio/list/recycler/SwipeActionsCallback.kt +++ b/app/src/main/java/org/oxycblt/auxio/list/recycler/SwipeActionsCallback.kt @@ -123,17 +123,20 @@ class SwipeActionsCallback( } else { dX } - if (actionState == ItemTouchHelper.ACTION_STATE_SWIPE && isCurrentlyActive) { - // Arm when the finger passes the cell; disarm when pulled back inside it. - val raw = abs(dX) - val reveal = revealWidth(viewHolder).toFloat() - if (raw > reveal) { - armedViewHolder = viewHolder - armedAction = if (dX > 0) SwipeAction.QUEUE else SwipeAction.PLAY_NEXT - } else if (raw < reveal * 0.5f) { - armedViewHolder = null - armedAction = null + if (actionState == ItemTouchHelper.ACTION_STATE_SWIPE) { + if (isCurrentlyActive) { + // Arm when the finger passes the cell; disarm when pulled back inside it. + val raw = abs(dX) + val reveal = revealWidth(viewHolder).toFloat() + if (raw > reveal) { + armedViewHolder = viewHolder + armedAction = if (dX > 0) SwipeAction.QUEUE else SwipeAction.PLAY_NEXT + } else if (raw < reveal * 0.5f) { + armedViewHolder = null + armedAction = null + } } + // Draw whenever the row is displaced, including the spring-back's frames. if (clampedDX != 0f) { drawUnderlay(c, viewHolder, clampedDX) }