Hello... can anyone help with this question on SwipeToDismiss? <https://stackoverflow.com/questions/...
t
j
confirmStateChange
is a callback that gets invoked on fling (https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:compose/[…]ipeable.kt;l=372;drc=32d335ae09b704ce6e52b3e80d28a1cc8cdae474). When you programmatically call
dismiss
(which calls
animateTo
), the intention is clear, so
confirmStateChange
is not invoked. You shouldn't be using this for callbacks about the state's value as there are a number of different ways it might be updated. It also gets invoked to confirm a state change, so you are executing an action before the animation will be done. Use a
snapshotFlow
instead to observe the
currentValue
🙂
cc @Ale Stamato