Tower Guidev2
12/16/2022, 1:43 PMjossiwolf
12/16/2022, 7:51 PMconfirmStateChange
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
🙂jossiwolf
12/16/2022, 7:51 PM