Skip to content

Use a sharedTransitionScope in the list-detail and two pane recipes to enable smooth transitions between scenes#232

Draft
bsagmoe wants to merge 1 commit intomainfrom
bsagmoe/sharedtransitionscope
Draft

Use a sharedTransitionScope in the list-detail and two pane recipes to enable smooth transitions between scenes#232
bsagmoe wants to merge 1 commit intomainfrom
bsagmoe/sharedtransitionscope

Conversation

@bsagmoe
Copy link
Contributor

@bsagmoe bsagmoe commented Feb 13, 2026

No description provided.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @bsagmoe, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the user experience in the list-detail and two-pane navigation examples by introducing shared element transitions. By leveraging the SharedTransitionLayout in Compose, the application now provides a more fluid and visually appealing navigation flow between different screens. This update also includes an upgrade to a newer alpha version of the navigation3 library, ensuring compatibility and access to the latest features.

Highlights

  • Shared Transition Integration: The NavDisplay composable in both the list-detail and two-pane navigation recipes is now wrapped with SharedTransitionLayout, and its sharedTransitionScope is passed to NavDisplay. This change enables smooth shared element transitions between scenes.
  • Dependency Update: The navigation3 library dependency has been updated from version 1.0.0 to 1.1.0-alpha03 in the libs.versions.toml file.
  • UI Refinement: Minor UI adjustments were made in Content.kt, including reordering imports and applying a background color to the LazyColumn in the ConversationListScreen.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • app/src/main/java/com/example/nav3recipes/scenes/listdetail/Content.kt
    • Reordered import statements for better organization.
    • Applied a background modifier to the LazyColumn in ConversationListScreen.
  • app/src/main/java/com/example/nav3recipes/scenes/listdetail/ListDetailActivity.kt
    • Added SharedTransitionLayout import.
    • Wrapped the NavDisplay composable with SharedTransitionLayout.
    • Passed the sharedTransitionScope to NavDisplay to enable shared element transitions.
  • app/src/main/java/com/example/nav3recipes/scenes/twopane/TwoPaneActivity.kt
    • Added SharedTransitionLayout and SharedTransitionScope imports.
    • Wrapped the NavDisplay composable with SharedTransitionLayout.
    • Passed the sharedTransitionScope to NavDisplay to enable shared element transitions.
  • gradle/libs.versions.toml
    • Updated the navigation3 dependency version from 1.0.0 to 1.1.0-alpha03.
Activity
  • No specific activity (comments, reviews, etc.) has been recorded for this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request correctly sets up SharedTransitionLayout for both the list-detail and two-pane recipes to enable shared element transitions. The dependency for navigation3 has also been updated to a version that supports this feature. I've found one minor issue regarding a missing opt-in annotation for an experimental API in TwoPaneActivity, which should be addressed.

ContentBase(
"Product ${product.id} ",
Modifier.background(colors[product.id % colors.size])
SharedTransitionLayout {
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The SharedTransitionLayout composable is an experimental API and requires an opt-in. Please annotate the onCreate function with @OptIn(ExperimentalSharedTransitionApi::class) to resolve this. You can see an example of this in ListDetailActivity.

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.

2 participants