Michal Klimczak
08/24/2022, 12:31 PMLazyListState.animateScrollToItem(0)
suspends indefinitely whenever I intercept the scroll animation by touching the list. Thus blocking the collection for any consecutive animations.
Tried working around with withTimeout
, but it seems like the animateScrollToItem
animation loop has no way of supporting cancellation (no yield
in the while
loop).animateScrollToItem(0)
in a separate coroutine is a working hack, but it still leaves the broken coroutine hanging forever (memory leak)Filip Wiesner
08/24/2022, 1:29 PMCancellationException
and don't rethrow it? š¤Michal Klimczak
08/24/2022, 2:06 PMFilip Wiesner
08/24/2022, 2:28 PMSharedFlow
collector? If you intercept the scroll animation, the animateScrollToItem
throws CancellationException
and the SharedFlow
collector will be cancelled, meaning that no other emit will be collected. So maybe it's not that it suspends forever but that there is no collector and you will not receive any value.
I am not 100% sure. Just throwing ideas.Michal Klimczak
08/24/2022, 3:02 PM