Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stabilise Compose Animations API #110

Closed
6 tasks done
arkivanov opened this issue May 18, 2022 · 9 comments · Fixed by #314
Closed
6 tasks done

Stabilise Compose Animations API #110

arkivanov opened this issue May 18, 2022 · 9 comments · Fixed by #314

Comments

@arkivanov
Copy link
Owner

arkivanov commented May 18, 2022

Docs: link. Collecting feedback and use cases here.

Points to improve:

  • Get rid of Direction.IDLE using movableContentOf (blocked by Compose 1.2.0 release)
  • Make click interception configurable? Or replace with another solution? See b/214231672
  • Nullable StackAnimator in StackAnimation selector
  • Shared element transitions (perhaps LookaheadLayout + movableContentOf should work out of the box when they land in Compose)
  • Add otherChild argument to stackAnimation selector
  • Add minAlpha argument to fade animation
@plusmobileapps
Copy link
Contributor

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?

@arkivanov
Copy link
Owner Author

arkivanov commented Jul 24, 2022

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.

@arkivanov
Copy link
Owner Author

arkivanov commented Jul 24, 2022

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.

@arkivanov
Copy link
Owner Author

arkivanov commented Jul 24, 2022

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.

Screen.Recording.2022-07-24.at.17.27.00.mov

@plusmobileapps
Copy link
Contributor

It seems like the animation documentation is out of date since the stack navigation changes. I'm assuming childAnimation is supposed to be stackAnimation?

@arkivanov
Copy link
Owner Author

Thanks for raising! I updated the documentation a while ago with multiple rounds of self code review, but seems like I missed this one.

@aartikov
Copy link

aartikov commented Sep 4, 2022

@arkivanov Hi. Is it possible to use AnimatedContent with Decompose?

@arkivanov
Copy link
Owner Author

@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.

@aartikov
Copy link

aartikov commented Sep 5, 2022

@arkivanov Thank you!

@arkivanov arkivanov changed the title Stabilise the Compose Animations API Stabilise Compose Animations API Jan 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants