list: let the swipe reveal stretch to three cell widths

This commit is contained in:
jay
2026-11-12 16:52:51 -05:00
parent 7efa7bff59
commit 1f3e319552
@@ -165,15 +165,15 @@ class SwipeActionsCallback(
/**
* Map a raw drag to its visual translation: one-to-one up to [reveal], then increasing
* resistance asymptotic to twice the reveal, so the row can be pulled past the cell but
* fights back more the further it goes.
* resistance asymptotic to three times the reveal, so the row can be pulled well past the
* cell but fights back more the further it goes.
*/
private fun rubberBand(dX: Float, reveal: Float): Float {
val past = abs(dX) - reveal
if (past <= 0f) {
return dX
}
return sign(dX) * (reveal + past / (1f + past / reveal))
return sign(dX) * (reveal + past / (1f + past / (2f * reveal)))
}
/** The square underlay cell's width: a standard large touchable size. */