Open marzaise opened 1 month ago
Hi. Show your NiaNavHost
and TopLevelDestination
content.
FWIW, I think this is slightly related to https://issuetracker.google.com/issues/308334893, where I have reported the same thing (see #comment8).
A related issue here is that the app switches the active navigation bar tab from For You to Interests when you tap a topic from inside of the For You tab. This, IMO, should never happen. The app should instead remain on the same For You tab, but with the interest content that the user requested to see.
The problem then lies in the way the app checks if a route exists in the hierarchy. Since the TopicScreen
's destination only exists in a graph in InterestsListDetailScreen
, the hierarchy check will return true
only for the Interests top level route:
private fun NavDestination?.isRouteInHierarchy(route: KClass<*>) =
this?.hierarchy?.any {
it.hasRoute(route)
} ?: false
Following up here, as well: There is a public API that I was unaware of that gives access to the back-stack of a given Navigator. It is now documented as per https://android-review.googlesource.com/3312339. :raised_hands:
Is there an existing issue for this?
Is there a StackOverflow question about this issue?
What happened?
A bug happened! Steps to reproduce:
Current behavior Clicking on the first tab of the Navigation Bar (For You) does nothing.
Expected behavior Clicking on the first tab of the Navigation Bar (For You) should navigate to 'For You' (or perhaps perform a back action in this case).
Video foryou_bug_nia.webm
Relevant logcat output
No response
Code of Conduct