Skip to content

Conversation

jbw0033
Copy link
Collaborator

@jbw0033 jbw0033 commented Aug 19, 2025

This commit adds a recipe that demonstrates how to display a navigation destination within a Material ModalBottomSheet.

It introduces BottomSheetSceneStrategy, a SceneStrategy that can be added to a NavDisplay. This strategy checks for specific metadata on a NavEntry to determine if it should be rendered as a bottom sheet.

A new BottomSheetActivity is added to showcase how to use this strategy.

#32

dturner and others added 20 commits July 21, 2025 15:16
* main:
  Remove comments
  Add headings to the recipe picker
  Fix typo
  Add a recipe for creating dialogs.
  Add CODEOWNERS
  Add build workflow
* main:
  Update library versions
  Remove the extra blank line at end of CODEOWNERS file
  Update CODEOWNERS file
This commit adds a recipe that demonstrates how to display a navigation
destination within a Material `ModalBottomSheet`.

It introduces `BottomSheetSceneStrategy`, a `SceneStrategy` that can be
added to a `NavDisplay`. This strategy checks for specific metadata on a
`NavEntry` to determine if it should be rendered as a bottom sheet.

A new `BottomSheetActivity` is added to showcase how to use this
strategy.
@jbw0033 jbw0033 requested a review from dturner as a code owner August 19, 2025 03:33
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.

Summary of Changes

Hello @jbw0033, 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 introduces a new "recipe" demonstrating how to integrate Material Design ModalBottomSheet components with the Nav3 navigation library. It provides a custom SceneStrategy that allows navigation destinations to be displayed as bottom sheets, enhancing UI flexibility for Android applications.

Highlights

  • New BottomSheetSceneStrategy: Introduced BottomSheetSceneStrategy, a custom SceneStrategy for NavDisplay that enables rendering navigation entries as Material ModalBottomSheet components.
  • Metadata-driven Bottom Sheet Display: Implemented a metadata-based mechanism (BottomSheetSceneStrategy.bottomSheet()) to designate specific NavEntry instances for display within a bottom sheet.
  • New Example Activity: Added BottomSheetActivity as a comprehensive example showcasing the practical application and integration of the new bottom sheet navigation strategy.
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 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.

@jbw0033
Copy link
Collaborator Author

jbw0033 commented Aug 19, 2025

@ianhanniballake

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 introduces a new recipe for displaying a navigation destination inside a Material ModalBottomSheet. The implementation is well-structured, adding a BottomSheetSceneStrategy and a corresponding BottomSheetActivity to demonstrate its usage. The code is clear and effectively showcases the feature. I have one minor suggestion to improve adherence to Kotlin's coding conventions.

@alirahimpour89
Copy link

What happens if you have a button in the bottomsheet that pop the bottomsheet from the backstack, would that mean no animation? How would you handle that?

Doing this for Kotlin code syntax
@jbw0033
Copy link
Collaborator Author

jbw0033 commented Aug 19, 2025

What happens if you have a button in the bottomsheet that pop the bottomsheet from the backstack, would that mean no animation? How would you handle that?

That is something that would be a good feature request to file here for the material team to address.

@alirahimpour89
Copy link

What happens if you have a button in the bottomsheet that pop the bottomsheet from the backstack, would that mean no animation? How would you handle that?

That is something that would be a good feature request to file here for the material team to address.

But is it even possible with the current implementation of nav3 and the scenes? I can think of some ugly hacks but no clean way with the current implementation, that is why I ask here? Maybe I just missed something but I think this receipt show that too because for me the this receipt would not be final without having that animation because it is a pretty common thing if you for example have some kind of menu in the bottom sheet. Because the material 3 bottom sheet has everything it needs to implement it but I don't think the nav3 lib does but I can of course have missed something 🙂

@jbw0033 jbw0033 requested a review from claraf3 as a code owner October 2, 2025 16:05
jbw0033 and others added 27 commits October 2, 2025 16:06
This commit adds a recipe that demonstrates how to display a navigation
destination within a Material `ModalBottomSheet`.

It introduces `BottomSheetSceneStrategy`, a `SceneStrategy` that can be
added to a `NavDisplay`. This strategy checks for specific metadata on a
`NavEntry` to determine if it should be rendered as a bottom sheet.

A new `BottomSheetActivity` is added to showcase how to use this
strategy.
Doing this for Kotlin code syntax
# Conflicts:
#	app/src/main/java/com/example/nav3recipes/RecipePickerActivity.kt
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
* main: (21 commits)
  Update README.md
  Update README.md
  Update README.md
  Update README.md
  Update README.md
  Move Material recipes to their specific package
  Addressing AI code review
  Slight formatting change
  Add koin injected ViewModel recipe
  Fix naming
  Update README file
  Fix comments
  Fix comments
  Update dependencies to sync with Supporting Pane PR
  Create Supporting Pane Recipe
  Create Supporting Pane Recipe
  Add link to bug
  Address Gemini feedback
  Replace SnapshotStateList with NavBackStack
  Update to latest library versions and disable snapshot artifact repo
  ...
Fix imports and remove extra name attribute in manifest.
* main:
  Update gradle/libs.versions.toml
  Update to alpha10
This PR adds a migration guide for navigating from Navigation Compose (aka Nav2) to Navigation 3. It includes a guide and accompanying code recipes in the `migration` package.
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.

6 participants