Skip to content
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

Navigation drawer examples #380

Merged
merged 20 commits into from
Oct 14, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Renaming functions
  • Loading branch information
jakeroseman committed Oct 14, 2024
commit cd1b543891694245708133f164032d5a8b8a2cc2
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ import kotlinx.coroutines.launch

@Composable
fun NavigationDrawerExamples() {
DismissibleDrawerExample { innerPadding ->
// Add more examples here in future if necessary.

DetailedDrawerExample { innerPadding ->
Box(modifier = Modifier.padding(innerPadding)) {
Text(
"Swipe from left edge or use menu icon to open the dismissible drawer",
Expand All @@ -40,9 +42,9 @@ fun NavigationDrawerExamples() {
}

@OptIn(ExperimentalMaterial3Api::class)
// [START android_compose_components_drawerexample]
// [START android_compose_components_detaileddrawerexample]
@Composable
fun DismissibleDrawerExample(
fun DetailedDrawerExample(
content: @Composable (PaddingValues) -> Unit
) {
val drawerState = rememberDrawerState(initialValue = DrawerValue.Closed)
Expand Down Expand Up @@ -110,10 +112,10 @@ fun DismissibleDrawerExample(
}
}
}
// [END android_compose_components_drawerexample]
// [END android_compose_components_detaileddrawerexample]

@Preview
@Composable
fun DismissibleDrawerExamplePreview() {
fun DetailedDrawerExamplePreview() {
NavigationDrawerExamples()
}
Loading