Decompose: stack animation break text color
- click
testA
button, you could seetest
button enable/disable correctly. - switch to another tab and switch back
- click
testA
button again, text color oftest
button stick with same color (but button color change state correctly). - remove stack animation, text color change correctly.
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 17 (10 by maintainers)
The cause issue in Compose has just been marked as fixed. I think the fix should go in the next Compose release (22nd April).
Maybe it worth releasing
v2.0.0
together with the API changes from #327?movableContentOf
appears to be pretty unstable, but it is used by Stack Animations in order to allow having different animations for different children/directions/etc. The should be possible to avoidmovableContentOf
for the simple variant of stackAnimation function withoutselector
argument. Though some minor changes to the API will be still required. For the variant withselector
this is even more complicated.For now I’m willing to wait for the fix and monitor how this will be doing in the future. The sibling issue #326 with scrolling in JetBrains Compose is already fixed (and perhaps released). Breaking the API is pretty undesirable, as
movableContentOf
allowed me to make the API simpler and concise.It appears that accompanist uses
androidx.compose.animation
, which has a fixed set of possible transitions. For instance, here is EnterTransition. It has fade, scale, slide and expand, and perhaps combinations. But it doesn’t look possible to define custom transitions. In this case it’s obvious thatmovableContentOf
is not needed.Stack Animation API in Decompose allows custom transitions. But anyway, I will think if there any ways to avoid
movableContentOf
.The fix on the Decompose side will be released in the next major update, as described in https://github.com/arkivanov/Decompose/issues/330#issuecomment-1454792564.
I will check accompanist animations, maybe we could derive something from there. Thanks for sharing.
Thanks for providing the workaround!