mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-15 04:07:03 +05:30
fix: try fixing backstack introspection
This commit is contained in:
parent
699afafcf9
commit
ec70c9ab56
1 changed files with 4 additions and 4 deletions
|
@ -136,7 +136,7 @@ fun Nav3Screen(
|
||||||
TopAppBar(
|
TopAppBar(
|
||||||
modifier = Modifier.shadow(8.dp),
|
modifier = Modifier.shadow(8.dp),
|
||||||
navigationIcon = {
|
navigationIcon = {
|
||||||
if (backStack.none { it in navDestinations }) {
|
if (backStack.firstOrNull() !in navDestinations) {
|
||||||
IconButton(onClick = { if (backStack.removeLastOrNull() == null) activity?.finish() }) {
|
IconButton(onClick = { if (backStack.removeLastOrNull() == null) activity?.finish() }) {
|
||||||
Icon(
|
Icon(
|
||||||
imageVector = Icons.AutoMirrored.Filled.ArrowBack,
|
imageVector = Icons.AutoMirrored.Filled.ArrowBack,
|
||||||
|
@ -152,12 +152,12 @@ fun Nav3Screen(
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
title = {
|
title = {
|
||||||
if (backStack.any { it in navDestinations }) {
|
if (backStack.firstOrNull() in navDestinations) {
|
||||||
Text(text = stringResource(R.string.app_name), fontWeight = FontWeight.Bold)
|
Text(text = stringResource(R.string.app_name), fontWeight = FontWeight.Bold)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
actions = {
|
actions = {
|
||||||
if (backStack.any { it in navDestinations }) {
|
if (backStack.firstOrNull() in navDestinations) {
|
||||||
IconButton(onClick = { backStack.add(Search) }) {
|
IconButton(onClick = { backStack.add(Search) }) {
|
||||||
Icon(imageVector = Icons.Filled.Search, contentDescription = "Search posts")
|
Icon(imageVector = Icons.Filled.Search, contentDescription = "Search posts")
|
||||||
}
|
}
|
||||||
|
@ -173,7 +173,7 @@ fun Nav3Screen(
|
||||||
ClawNavigationBar(
|
ClawNavigationBar(
|
||||||
backStack,
|
backStack,
|
||||||
items = navItems,
|
items = navItems,
|
||||||
isVisible = backStack.any { it in navDestinations },
|
isVisible = backStack.firstOrNull() in navDestinations,
|
||||||
hazeState = hazeState,
|
hazeState = hazeState,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue