On click on title also toggling drawer state

This commit is contained in:
dankito 2024-10-04 09:06:00 +02:00
parent 08d6e62a38
commit a532130fcb
1 changed files with 9 additions and 4 deletions

View File

@ -40,12 +40,17 @@ fun BottomBar(showMenuDrawer: Boolean = true) {
val coroutineScope = rememberCoroutineScope() val coroutineScope = rememberCoroutineScope()
fun toggleDrawerState() {
coroutineScope.launch {
uiState.drawerState.value.toggle()
}
}
BottomAppBar { BottomAppBar {
if (showMenuDrawer) { if (showMenuDrawer) {
IconButton( IconButton(
onClick = { coroutineScope.launch { onClick = { toggleDrawerState() }
uiState.drawerState.value.toggle()
} }
) { ) {
Icon(Icons.Filled.Menu, contentDescription = "Open Navigation Drawer with sidebar menu") Icon(Icons.Filled.Menu, contentDescription = "Open Navigation Drawer with sidebar menu")
} }
@ -68,7 +73,7 @@ fun BottomBar(showMenuDrawer: Boolean = true) {
selectedAccount.bank.displayName selectedAccount.bank.displayName
} }
Text(title, color = color, maxLines = 1, overflow = TextOverflow.Ellipsis) Text(title, color = color, maxLines = 1, overflow = TextOverflow.Ellipsis, modifier = Modifier.clickable { toggleDrawerState() })
} }
} }