gowtham 6674
08/08/2025, 7:37 AMgowtham 6674
08/08/2025, 7:38 AM@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun DetailedDrawerExample(
content: @Composable (PaddingValues) -> Unit
) {
val drawerState = rememberDrawerState(initialValue = DrawerValue.Closed)
val scope = rememberCoroutineScope()
ModalNavigationDrawer(
drawerContent = {
ModalDrawerSheet() {
Column(
modifier = Modifier.padding(horizontal = 16.dp)
.verticalScroll(rememberScrollState())
) {
Spacer(Modifier.height(12.dp))
Text("Drawer Title", modifier = Modifier.padding(16.dp), style = MaterialTheme.typography.titleLarge)
HorizontalDivider()
Text("Section 1", modifier = Modifier.padding(16.dp), style = MaterialTheme.typography.titleMedium)
NavigationDrawerItem(
label = { Text("Item 1") },
selected = false,
onClick = { /* Handle click */ }
)
}
}
},
drawerState = drawerState
) {
Scaffold(
topBar = {
TopAppBar(
title = { Text("Navigation Drawer Example") },
navigationIcon = {
IconButton(onClick = {
scope.launch {
if (drawerState.isClosed) {
drawerState.open()
} else {
drawerState.close()
}
}
}) {
Icon(<http://Icons.Default.Menu|Icons.Default.Menu>, contentDescription = "Menu")
}
}
)
}
) { innerPadding ->
content(innerPadding)
}
}
}
Alex Styl
08/08/2025, 8:02 AMWindow
. you can get it via the host activity.
I >think< there is a composition local to get the current activity these days. so either use that or forward the window down the tree. I do that on unstyled to forward the dialog's window. you can follow the same pattern
PS: this is a better fit for #C04TPPEQKEJChrimaeon
08/08/2025, 8:19 AMsetColor
for the status bar was removed because of edge-to-edge that you probably enabled. So you need to handle the window insets yourself and draw a box underneath the stationary with the color you want.Chrimaeon
08/08/2025, 8:20 AMChrimaeon
08/08/2025, 8:23 AMgowtham 6674
08/08/2025, 9:31 AMgowtham 6674
08/08/2025, 10:43 AM