Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@alexvanyo
Copy link
Contributor

Updates to use the latest snapshot of navigation3, which moves a couple things around. This also uses the latest prototype from the WIP integration with material3-adaptive.

@alexvanyo alexvanyo requested a review from sashalukin May 9, 2025 00:05
Copy link

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

Hello @alexvanyo, 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!

Summary of Changes

This pull request updates the navigation3 library to the latest snapshot and integrates it with the latest prototype from the material3-adaptive library. The primary changes involve updating the compileSdk version, modifying dependencies for navigation3, and adjusting the MainNavigation composable to use the new NavDisplay and metadata structures for pane roles.

Highlights

  • Navigation3 Update: The navigation3 library is updated to the latest snapshot, which includes changes in how navigation components are structured and used.
  • Material3-adaptive Integration: The pull request integrates with the latest prototype of material3-adaptive, adapting the UI for different screen sizes and layouts.
  • Dependency Changes: The dependencies for navigation3 are updated to use navigation3-runtime and navigation3-ui instead of a single navigation3 dependency.
  • ListDetailPaneScaffoldScene Implementation: A new file ListDetailScene.kt is added, which implements a ListDetailPaneScaffoldScene to manage the layout and back navigation behavior for list-detail scenarios.
  • Metadata Updates: The metadata for NavEntry is updated to use listPaneMetadata and detailPaneMetadata instead of paneRole for specifying pane roles in the ListDetailPaneScaffold.

Changelog

Click here to see the changelog
  • app/build.gradle.kts
    • Updated compileSdk to 36.
    • Replaced implementation(libs.androidx.navigation3) with implementation(libs.androidx.navigation3.runtime) and implementation(libs.androidx.navigation3.ui).
  • app/src/main/java/com/google/android/samples/socialite/ui/Main.kt
    • Removed unused import androidx.compose.material3.adaptive.layout.ListDetailPaneScaffoldRole.
    • Replaced androidx.navigation3.NavEntry with androidx.navigation3.runtime.NavEntry.
    • Replaced androidx.navigation3.SceneNavDisplay with androidx.navigation3.ui.NavDisplay.
    • Replaced ListDetailPaneScaffoldSceneStrategy.paneRole with ListDetailPaneScaffoldSceneStrategy.listPaneMetadata and ListDetailPaneScaffoldSceneStrategy.detailPaneMetadata.
  • app/src/main/java/com/google/android/samples/socialite/ui/navigation/ListDetailScene.kt
    • Added new file implementing ListDetailPaneScaffoldScene to handle adaptive layouts and back navigation within a list-detail scaffold.
  • app/src/main/java/com/google/android/samples/socialite/ui/navigation/ListDetailSceneStrategy.kt
    • Updated package level TODO comment.
    • Modified the calculateScene function to return a Scene<T>? instead of SceneStrategyResult<T>?.
    • Replaced paneRole with listPaneMetadata, detailPaneMetadata, and extraPaneMetadata for setting pane roles.
    • Removed the ListDetailPaneScaffoldScene class from this file and moved it to ListDetailScene.kt.
  • gradle/libs.versions.toml
    • Replaced androidx-navigation3 with androidx-navigation3-runtime and androidx-navigation3-ui.
  • settings.gradle.kts
    • Updated the snapshot build URL for Navigation 3 library to https://androidx.dev/snapshots/builds/13467503/artifacts/repository.
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

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 issue 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 is currently in preview and 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 to provide feedback.

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.


A shifting scene,
Panes adapt, a graceful dance,
UI finds its form.

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

@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

The pull request updates the navigation library to the latest snapshot and integrates it with material3-adaptive. The changes involve updating dependencies, modifying imports, and adjusting the code to use the new navigation APIs. Overall, the changes seem reasonable, but there are a few areas that could be improved.

Summary of Findings

  • Dependency Updates: The pull request updates the navigation3 dependency to the latest snapshot. It's important to ensure that these updates are thoroughly tested and don't introduce any regressions or compatibility issues.
  • API Changes: The code has been modified to use the new navigation APIs. It's crucial to verify that these changes are correct and that the application's navigation behavior is as expected.
  • ListDetailPaneScaffoldScene: The ListDetailPaneScaffoldScene class has been added to handle list-detail layouts. It's important to ensure that this class is well-documented and that its functionality is clear.
  • ListDetailSceneStrategy: The ListDetailSceneStrategy class has been updated to use the new navigation APIs. It's crucial to verify that these changes are correct and that the application's navigation behavior is as expected.

Merge Readiness

The pull request updates the navigation library to the latest snapshot and integrates it with material3-adaptive. While the changes seem reasonable, it's important to ensure that the dependency updates are thoroughly tested and don't introduce any regressions or compatibility issues. I am unable to approve this pull request, and users should have others review and approve this code before merging. Given the medium severity comments, I recommend that the pull request not be merged until those are addressed.

Copy link
Contributor

@sashalukin sashalukin left a comment

Choose a reason for hiding this comment

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

Thanks! It's great we can add a placeholder now.

@alexvanyo alexvanyo force-pushed the av/nav3-snapshot-update branch from 47e4bbe to b217132 Compare May 9, 2025 18:29
@alexvanyo alexvanyo merged commit 1cd7b12 into p-and-d May 9, 2025
2 checks passed
@lemberh
Copy link

lemberh commented Jun 5, 2025

Please update documentation https://developer.android.com/guide/navigation/navigation-3/get-started
from implementation(libs.androidx.navigation3) to implementation(libs.androidx.navigation3.runtime) and implementation(libs.androidx.navigation3.ui)

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.

4 participants