I use code for listen swipe
Card(
modifier = Modifier
.offset { IntOffset(offset.roundToInt(), 0) }
.pointerInput(Unit) {
detectHorizontalDragGestures(
onDragEnd = { offset = 0f },
onHorizontalDrag = { change, dragAmount ->
offset += (dragAmount / density) * sensitivityFactor
when {
offset > swipeThreshold -> dismissRight = true
offset < -swipeThreshold -> dismissLeft = true
}
if (change.positionChange() != Offset.Zero) change.consume()
}
)
}
) {}
I also keep track dismissLeft
LaunchedEffect(dismissLeft) {
// Stop drag
}
How can I reset the animation (so that the card stops following my finger)?