-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
[Reply] Use NavigationSuite for nav UI components #1407
Conversation
Add material3-adaptive-navigation-suite to top level catalog and copy over to Reply.
Uses NavigationSuiteScaffoldLayout to create a navigation wrapper UI.
// Avoid opening the modal drawer when there is a permanent drawer or a bottom nav bar, | ||
// but always allow closing an open drawer. | ||
val gesturesEnabled = | ||
drawerState.isOpen || navLayoutType == NavigationSuiteType.NavigationRail |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This logic does makes sense for consistency, where the drawer will remain open if it was open, but maybe an alternative would be to just hide it immediately if the navigation layout type isn't a navigation rail? Not sure which way would be better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried something like that, and it looked fine when changing to a layout that isn't a rail. But when changing back to the rail the drawer opens again, and that's a bit jarring.
We can work around that with a LaunchedEffect
that calls drawerState.snapTo(Closed)
, but that feels more imperative than declarative.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
No description provided.