https://kotlinlang.org logo
#compose
Title
# compose
s

Sergey Y.

11/24/2023, 5:51 PM
Hello. I have some sort of overlay widget on top of my main content. I animate the appearance and disappearance of the overlay using the Transition animation API. On disappearance, I need to postpone the dismissal callback until the exit animation ends, otherwise the content of the overlay will simply disappear in one frame. I came up with this solution to await the transition end animation, but I'm wondering if there is a better way to do that. This feels a bit hacky to me.
d

Doris Liu

11/30/2023, 2:39 AM
snapshotFlow { transition.isRunning }.collect { if (it) { // The callback could go here }  }
would be the recommended way to get the finished event. 🙂
K 1
s

Sergey Y.

11/30/2023, 10:27 AM
Thank you.