Zoltan Demant
09/09/2022, 4:21 AMAnimatedContent
is not animating my content in a given scenario, despite targetState
having changed. It works in all other cases. Any ideas? More details in 🧵Zoltan Demant
09/09/2022, 4:24 AMslideInVertically + fadeOut
and slideOutVertically + fadeIn
.Ian Lake
09/09/2022, 4:29 AMcollectAsState()
then an if (data != null) { DetailScreen(data) }
, then you'll just be animating out an empty screen, which doesn't seem like what you'd wantZoltan Demant
09/09/2022, 4:31 AMZoltan Demant
09/09/2022, 4:33 AMZoltan Demant
09/09/2022, 4:54 AMdataFlow.take(1)
on the parent, then the animations runs fine 🤷🏽♂️ So definitely seems to be related to that, but I cant tell how. Ive gone through the entire loop multiple times and everything works exactly as expected.. basically: delete happens, cache is updated, triggers related flows to refresh, screen is updated.Ian Lake
09/09/2022, 5:00 AMresult.onSuccess { updateState }.onFailure { navigateBack }
call, did you log how many times the onSuccess
and onFailure
lambdas are being called? It would be interesting to know if you're somehow calling navigateBack
multiple times in a rowZoltan Demant
09/09/2022, 5:23 AMwithContext(IO)
block, and the result of that was then handled inside another withContext(IO)
block (my intention was to have both of those in the same block).
Theres literary no code outside the withContext blocks, and the entire call is invoked on Dispatchers.Default
. Id love to understand how that could have such an impact on this scenario! I also understand if thats impossible to say without way more details, all in all Im just glad that it works as expected 🙂