Last active
January 14, 2022 20:34
-
-
Save alexvanyo/67596d255b1d907518d88ac9038cc1bf to your computer and use it in GitHub Desktop.
A modal drawer that is window size aware
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright 2022 Google LLC. | |
// SPDX-License-Identifier: Apache-2.0 | |
val isExpandedScreen = windowSize == WindowSize.Expanded | |
ModalDrawer( | |
drawerContent = { | |
AppDrawer(/* ... */) | |
}, | |
// Only enable opening the drawer via gestures if the screen is not expanded | |
gesturesEnabled = !isExpandedScreen | |
) { | |
Row(/* ... */) { | |
if (isExpandedScreen) { | |
AppNavRail(/* ... */) | |
} | |
JetnewsNavGraph(/* ... */) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment