You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I am clicking on any AccountType it is showing only the first clicked Account Type in Navigation and also when it is showing Single Account screen, Navigation moves to Overview Tab.
The text was updated successfully, but these errors were encountered:
when I am following the this codelab, I found the same problem you mentioned above, to confirm this problem, I downloaded the end version code, and the end version code indeed had the bug, so I sloved it.
the problem occurred because this line of code. val currentScreen = rallyTabRowScreens.find { it.route == currentDestination?.route } ?: Overview
for a quick answer, just replace it with this line: val currentScreen = rallyTabRowScreens.find { it.route == currentDestination?.route || (it == Accounts && currentDestination?.route?.startsWith( SingleAccount.route ) == true) } ?: Overview
for a deep explanation, continue to read. when you navigate the single_account, actually this page's route can be one of the following:
single_account/Checking
single_account/Home Savings
single_account/Car Savings
of course, all of them can not match the tab routes: overview, accounts, bills, so the original code fall back to the overview page.
to solve this, you just need to add a condition to say that if the current route beyond the tab routes, but it starts with single_account, then the accounts tab should be highlighted.
hope this can answer your question.
remain-maomao
added a commit
to remain-maomao/codelab-android-compose
that referenced
this issue
Jun 12, 2024
When I am clicking on any AccountType it is showing only the first clicked Account Type in Navigation and also when it is showing Single Account screen, Navigation moves to Overview Tab.
The text was updated successfully, but these errors were encountered: