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
{{ message }}
This repository was archived by the owner on Jan 10, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: NavigationAdvancedSample/app/src/androidTest/java/com/example/android/navigationadvancedsample/BottomNavigationTest.kt
Copy file name to clipboardExpand all lines: NavigationAdvancedSample/app/src/main/java/com/example/android/navigationadvancedsample/NavigationExtensions.kt
+44-16
Original file line number
Diff line number
Diff line change
@@ -83,7 +83,7 @@ fun BottomNavigationView.setupWithNavController(
83
83
val firstFragmentTag = graphIdToTagMap[firstFragmentGraphId]
84
84
var isOnFirstFragment = selectedItemTag == firstFragmentTag
85
85
86
-
//For the navigation item that is selected...
86
+
//When a navigation item is selected
87
87
setOnNavigationItemSelectedListener { item ->
88
88
// Don't do anything if the state is state has already been saved.
89
89
if (fragmentManager.isStateSaved) {
@@ -131,22 +131,11 @@ fun BottomNavigationView.setupWithNavController(
131
131
}
132
132
}
133
133
134
-
// handle deep link
135
-
navGraphIds.forEachIndexed { index, navGraphId ->
136
-
val fragmentTag = getFragmentTag(index)
134
+
// Optional: on item reselected, pop back stack to the destination of the graph
0 commit comments