When using `SwipeToDismiss` I notice that very qui...
# compose
z
When using
SwipeToDismiss
I notice that very quick, short swipes (below thresholds) are triggered. Looking at the source code I am guessing that
velocityThreshold
has something to do with this. While slowly trying to dismiss my item and logging
dismissState.progress.fraction
, it always dismisses once it reaches my target theshold of 0.2f. However with fast swipes it triggers below that Can anyone help me fix this? I can not seem to edit that
velocityThreshold
value since it's not part of the
SwipeToDismiss
composable.
"The threshold (in dp per second) that the end velocity has to exceed in order to animate to the next state, even if the positional thresholds have not been reached." so yeah I am assuming velocity is the issue here
j
Yes, the velocity threshold takes precedence over positional thresholds as it expresses user intent. We currently don't expose the velocity threshold as param in SwipeToDismiss but received a request for it recently. I'll link it on Monday!
120 Views