Decompose
Decompose copied to clipboard
Stabilise the Compose Animations API
Docs: link. Collecting feedback and use cases here.
Points to improve:
- [x] Get rid of
Direction.IDLE
usingmovableContentOf
(blocked by Compose 1.2.0 release) - [ ] Make click interception configurable? Or replace with another solution? See b/214231672
- [x] Nullable
StackAnimator
inStackAnimation
selector - [x] Shared element transitions (perhaps
LookaheadLayout
+movableContentOf
should work out of the box when they land in Compose) - [x] Add
otherChild
argument tostackAnimation
selector
It would be nice to have a shared element transition between configurations, not sure if something similar to this sample could be done with Decompose?
I have a pending branch that should make it compatible with the official shared transitions (LookaheadLayout
+ movableContentOf
) when they land in Compose. The branch is blocked by the availability of movableContentOf
. Waiting for the stable MPP Compose 1.2.0.
Actually, I found that LookaheadLayout
is already available to try in Compose 1.3.0-alpha01
. I will play with it and provide some updates here.
Yep, LookaheadLayout
+ movableContentOf
should work just fine even with the current animations API. It is already available in Compose 1.3.0-alpha01
, however there are immediate bugs, e.g. LookaheadLayout doesn't support having LazyColumn inside, etc.
https://user-images.githubusercontent.com/26204457/180651812-462d4661-20e3-48e8-a0cb-6d341843e3c2.mov
It seems like the animation documentation is out of date since the stack navigation changes. I'm assuming childAnimation
is supposed to be stackAnimation
?
Thanks for raising! I updated the documentation a while ago with multiple rounds of self code review, but seems like I missed this one.
@arkivanov Hi. Is it possible to use AnimatedContent with Decompose?
@aartikov Technically it should be possible. E.g. the Child Stack
just exposes Value<ChildStack<C, T>>
- so you can use something your own instead of the Children
function, with AnimatedContent
. You can also try the StackAnimation { } function that just provides the current ChildStack
and it's up to you how to render children.
@arkivanov Thank you!