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

[Jetsnack] Adding shared elements to Jetsnack 🎉 #1314

Merged
merged 67 commits into from
Aug 8, 2024

Conversation

riggaroo
Copy link
Collaborator

@riggaroo riggaroo commented Apr 4, 2024

Adding shared elements between Home feed and SnackDetail.

Introduced SnackSharedElementKey to create a unique key for the shared element to match.

Using Modifier.sharedBounds() on the Card container, and Modifier.sharedElement() on the Image.

Using Modifier.sharedBounds() with Modifier.animateEnterExit() on Text.

The above modifiers require being in an AnimatedVisibilityScope and SharedTransitionScope, in order to use the correct scope at the correct point, we save the scopes in a CompositionLocal and retrieve it when required.

jetsnack.mp4

@riggaroo riggaroo changed the title Adding Shared elements to Jetsnack Adding shared elements to Jetsnack 🎉 Apr 5, 2024
@riggaroo riggaroo marked this pull request as ready for review April 22, 2024 14:31
@yongsuk44
Copy link
Contributor

Will values be added to the 'element' tab later, or is it normal for it to be empty. In my opinion, it would be convenient for debugging to display the values applied to parameters other than the key in sharedContentState.

스크린샷 2024-05-21 오후 5 34 40

riggaroo and others added 6 commits June 19, 2024 09:52
# Conflicts:
#	Jetsnack/app/src/main/java/com/example/jetsnack/model/Snack.kt
#	Jetsnack/app/src/main/java/com/example/jetsnack/ui/components/Snacks.kt
#	Jetsnack/app/src/main/java/com/example/jetsnack/ui/snackdetail/SnackDetail.kt
#	Jetsnack/app/src/main/res/drawable-nodpi/almonds.jpg
#	Jetsnack/app/src/main/res/drawable-nodpi/cupcake.jpg
#	Jetsnack/app/src/main/res/drawable-nodpi/fruit.jpg
#	Jetsnack/app/src/main/res/drawable-nodpi/gingerbread.jpg
#	Jetsnack/app/src/main/res/drawable-nodpi/gluten_free.jpg
#	Jetsnack/app/src/main/res/drawable-nodpi/nuts.jpg
#	Jetsnack/app/src/main/res/drawable-nodpi/paleo.jpg
#	Jetsnack/app/src/main/res/drawable-nodpi/pretzels.jpg
@riggaroo riggaroo changed the title Adding shared elements to Jetsnack 🎉 [Jetsnack] Adding shared elements to Jetsnack 🎉 Aug 2, 2024
@riggaroo riggaroo merged commit d5c7da6 into compose-latest Aug 8, 2024
20 checks passed
@riggaroo riggaroo deleted the jetsnack/shared-element branch August 8, 2024 15:15
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

4 participants