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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP - Shared elements experimenting #1330

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft

Conversation

stagg
Copy link
Collaborator

@stagg stagg commented Apr 8, 2024

Playing with the new shared elements api over in the star sample to avoid some KMP stuff.

Right now this has two locals for the current scopes, need to clean that up a bit 馃槄

Q's

  • Do shared elements into Overlays make sense, as the element is visible in both
  • Distinction/access for sub-circuits, need to be aware that you have the Nav transition and animation scope
  • Should some of this be a receiver on the UI? Is this a duplicated API? Just access the scope locals?
  • NavDecoration needs a rework to begin with (nesting doesn't really work) whats that look like?

Demo

shared.mp4

Comment on lines 126 to 132
.sharedBounds(
sharedContentState = rememberSharedContentState(key = "animal-${state.id}"),
animatedVisibilityScope = sharedElementAnimatedContentScope(),
)
.sharedElement(
state = rememberSharedContentState(key = "animal-image-${state.id}"),
animatedVisibilityScope = sharedElementAnimatedContentScope(),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a particular reason why you are adding both sharedBounds and sharedElement on this item?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope! Was moving them around and alternating between the two.

stagg added 2 commits May 7, 2024 13:38
- Interceptor to set the animation
- Interceptor to setup shared elements
- Add a new `thenIfSharedTransitionScope` modifier to use shared element api's
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 this pull request may close these issues.

None yet

2 participants