On click on title also toggling drawer state
This commit is contained in:
parent
08d6e62a38
commit
a532130fcb
|
@ -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() })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue