Fixed
Status Update
Comments
lo...@gmail.com <lo...@gmail.com> #2
Comment has been deleted.
il...@google.com <il...@google.com>
cl...@google.com <cl...@google.com> #3
since it is already marked as deprecated, we can probably do it by now.
ap...@google.com <ap...@google.com> #4
Opening diff shortly
ap...@google.com <ap...@google.com> #5
Project: platform/frameworks/support
Branch: androidx-master-dev
commit d576cbdc911cba16638a44fd8223391a90a07ef7
Author: Mike Nakhimovich <digitalbuddha@users.noreply.github.com>
Date: Tue Aug 11 09:30:34 2020
[GH] Hide deprecated internal API.
## Proposed Changes
* `RoomDatabase.java` has protected `mCallbacks` field which is leaking in the API docs, we should @Hide it.
## Testing
Test: Ran unit tests locally
## Issues Fixed
Fixes: 76109329
This is an imported pull request fromhttps://github.com/androidx/androidx/pull/61 .
Resolves #61
Github-Pr-Head-Sha: 6440daa3a63752c7f9d5ba2a390248cd85bc634f
GitOrigin-RevId: fe92d8466a59b44b218b6ca3cbd57dcda17992f7
Change-Id: Id599cdf5b02b32bdae0166266fb7da967598fe92
A room/runtime/api/current.ignore
M room/runtime/api/current.txt
M room/runtime/api/public_plus_experimental_current.txt
M room/runtime/api/restricted_current.txt
M room/runtime/src/main/java/androidx/room/RoomDatabase.java
https://android-review.googlesource.com/1396827
Branch: androidx-master-dev
commit d576cbdc911cba16638a44fd8223391a90a07ef7
Author: Mike Nakhimovich <digitalbuddha@users.noreply.github.com>
Date: Tue Aug 11 09:30:34 2020
[GH] Hide deprecated internal API.
## Proposed Changes
* `RoomDatabase.java` has protected `mCallbacks` field which is leaking in the API docs, we should @Hide it.
## Testing
Test: Ran unit tests locally
## Issues Fixed
Fixes: 76109329
This is an imported pull request from
Resolves #61
Github-Pr-Head-Sha: 6440daa3a63752c7f9d5ba2a390248cd85bc634f
GitOrigin-RevId: fe92d8466a59b44b218b6ca3cbd57dcda17992f7
Change-Id: Id599cdf5b02b32bdae0166266fb7da967598fe92
A room/runtime/api/current.ignore
M room/runtime/api/current.txt
M room/runtime/api/public_plus_experimental_current.txt
M room/runtime/api/restricted_current.txt
M room/runtime/src/main/java/androidx/room/RoomDatabase.java
ap...@google.com <ap...@google.com> #6
Project: platform/frameworks/support
Branch: androidx-main
commit f38354df9f714ac6ace3d4d454a27137b880cf56
Author: Clara Fok <clarafok@google.com>
Date: Fri Jan 13 10:52:07 2023
Refactor NavController.popBackStackInternal
In preparation for popBackStack support on exact routes
Test: n/a
Bug: 257514373
Change-Id: I38210db9dc5f2182416a5f6a7fd734287a2e7a21
M navigation/navigation-runtime/src/main/java/androidx/navigation/NavController.kt
https://android-review.googlesource.com/2387894
Branch: androidx-main
commit f38354df9f714ac6ace3d4d454a27137b880cf56
Author: Clara Fok <clarafok@google.com>
Date: Fri Jan 13 10:52:07 2023
Refactor NavController.popBackStackInternal
In preparation for popBackStack support on exact routes
Test: n/a
Bug: 257514373
Change-Id: I38210db9dc5f2182416a5f6a7fd734287a2e7a21
M navigation/navigation-runtime/src/main/java/androidx/navigation/NavController.kt
ap...@google.com <ap...@google.com> #7
Project: platform/frameworks/support
Branch: androidx-main
commit 718abc8e30980d228ad3811697cc95e11fe82c0c
Author: Clara Fok <clarafok@google.com>
Date: Fri Jan 13 11:44:28 2023
Add popBackStack support for exact routes
NavController.popBackStack(route) now supports routes with arguments partially or fully filled in, as long as the filled in arguments matches exactly the entry's filled in arguments.
This method defaults to original behavior of route matching through route pattern. If that fails, it recognizes the provided route as having
arguments filled in and will attempt to match with exact arguments.
Test: ./gradlew navigation:navigation-runtime:cC
Bug: 257514373
Relnote: "NavController.popBackStack(route) now supports routes with arguments partially or fully filled in. Note that the arguments has to be an exact match with the entry's arguments."
Change-Id: I3b37b5d2dd9423bf095cce5632f5208abfe49d70
M navigation/navigation-runtime/src/androidTest/java/androidx/navigation/NavControllerRouteTest.kt
M navigation/navigation-runtime/src/main/java/androidx/navigation/NavController.kt
https://android-review.googlesource.com/2387895
Branch: androidx-main
commit 718abc8e30980d228ad3811697cc95e11fe82c0c
Author: Clara Fok <clarafok@google.com>
Date: Fri Jan 13 11:44:28 2023
Add popBackStack support for exact routes
NavController.popBackStack(route) now supports routes with arguments partially or fully filled in, as long as the filled in arguments matches exactly the entry's filled in arguments.
This method defaults to original behavior of route matching through route pattern. If that fails, it recognizes the provided route as having
arguments filled in and will attempt to match with exact arguments.
Test: ./gradlew navigation:navigation-runtime:cC
Bug: 257514373
Relnote: "NavController.popBackStack(route) now supports routes with arguments partially or fully filled in. Note that the arguments has to be an exact match with the entry's arguments."
Change-Id: I3b37b5d2dd9423bf095cce5632f5208abfe49d70
M navigation/navigation-runtime/src/androidTest/java/androidx/navigation/NavControllerRouteTest.kt
M navigation/navigation-runtime/src/main/java/androidx/navigation/NavController.kt
ap...@google.com <ap...@google.com> #8
Project: platform/frameworks/support
Branch: androidx-main
commit 4c92643420b7fa8460c5f089e4eccee13fdabbbe
Author: Clara Fok <clarafok@google.com>
Date: Thu Jan 19 10:20:48 2023
Refactor NavDestination#matchDeepLink
Test: n/a
Bug: 257514373
Change-Id: I0c0366f37f0b2ef0eb70151c6ffd7f2fd30a69cf
M navigation/navigation-common/src/main/java/androidx/navigation/NavDestination.kt
https://android-review.googlesource.com/2396199
Branch: androidx-main
commit 4c92643420b7fa8460c5f089e4eccee13fdabbbe
Author: Clara Fok <clarafok@google.com>
Date: Thu Jan 19 10:20:48 2023
Refactor NavDestination#matchDeepLink
Test: n/a
Bug: 257514373
Change-Id: I0c0366f37f0b2ef0eb70151c6ffd7f2fd30a69cf
M navigation/navigation-common/src/main/java/androidx/navigation/NavDestination.kt
ap...@google.com <ap...@google.com> #9
Project: platform/frameworks/support
Branch: androidx-main
commit 3323f0d63b410dc7c3e68c7377f520a063e23043
Author: Clara Fok <clarafok@google.com>
Date: Thu Jan 19 16:46:08 2023
Add clearBackStack support for exact routes
NavController.clearBackStack(route) now supports routes with arguments partially or fully filled in, as long as the route is exact match with route used to popBackStack(route).
This method defaults to original behavior of route matching through route pattern. If that fails, it recognizes the provided route as having arguments filled in and will attempt to match with exact arguments.
Test: ./gradlew navigation:navigation-runtime:cC
Bug: 257514373
Relnote: "NavController.clearBackStack(route) now supports routes with arguments partially or fully filled in. Note that the arguments has to be an exact match with the route used to popBackStack(route)."
Change-Id: Ic678cf67db0f47f7b2778b039242773767735f2c
M navigation/navigation-runtime/src/androidTest/java/androidx/navigation/NavControllerRouteTest.kt
M navigation/navigation-runtime/src/main/java/androidx/navigation/NavController.kt
https://android-review.googlesource.com/2396202
Branch: androidx-main
commit 3323f0d63b410dc7c3e68c7377f520a063e23043
Author: Clara Fok <clarafok@google.com>
Date: Thu Jan 19 16:46:08 2023
Add clearBackStack support for exact routes
NavController.clearBackStack(route) now supports routes with arguments partially or fully filled in, as long as the route is exact match with route used to popBackStack(route).
This method defaults to original behavior of route matching through route pattern. If that fails, it recognizes the provided route as having arguments filled in and will attempt to match with exact arguments.
Test: ./gradlew navigation:navigation-runtime:cC
Bug: 257514373
Relnote: "NavController.clearBackStack(route) now supports routes with arguments partially or fully filled in. Note that the arguments has to be an exact match with the route used to popBackStack(route)."
Change-Id: Ic678cf67db0f47f7b2778b039242773767735f2c
M navigation/navigation-runtime/src/androidTest/java/androidx/navigation/NavControllerRouteTest.kt
M navigation/navigation-runtime/src/main/java/androidx/navigation/NavController.kt
ap...@google.com <ap...@google.com> #10
Project: platform/frameworks/support
Branch: androidx-main
commit 6609c2dbffca40ed6ae2742efe153409d07c4ae3
Author: Clara Fok <clarafok@google.com>
Date: Thu Jan 19 10:56:04 2023
Refactor helper functions in Navigation
Refactored helper functions NavController.restoreStateInternal and NavDeeplink.hasRoute
Test: n/a
Bug: 257514373
Change-Id: I30e28856b20c1a61a4cb2e6754a675803f81b3c5
M navigation/navigation-common/src/main/java/androidx/navigation/NavDestination.kt
M navigation/navigation-runtime/src/main/java/androidx/navigation/NavController.kt
https://android-review.googlesource.com/2396201
Branch: androidx-main
commit 6609c2dbffca40ed6ae2742efe153409d07c4ae3
Author: Clara Fok <clarafok@google.com>
Date: Thu Jan 19 10:56:04 2023
Refactor helper functions in Navigation
Refactored helper functions NavController.restoreStateInternal and NavDeeplink.hasRoute
Test: n/a
Bug: 257514373
Change-Id: I30e28856b20c1a61a4cb2e6754a675803f81b3c5
M navigation/navigation-common/src/main/java/androidx/navigation/NavDestination.kt
M navigation/navigation-runtime/src/main/java/androidx/navigation/NavController.kt
ap...@google.com <ap...@google.com> #11
Project: platform/frameworks/support
Branch: androidx-main
commit 8bac1f9b2b66fbd29277b14bb16cc586c05969ac
Author: Clara Fok <clarafok@google.com>
Date: Thu Jan 19 10:46:44 2023
Updated findDestination and findNode for routes
NavController.findDestination(route) and NavGraph.findNode(route) maintains original behavior of first finding based on route converted to destinationId. But if that fails, it will search based on NavDestination.matchDeepLink.
Refactored existing test toStringStartDestInNodesRouteWithID because it now properly matches with the startDestination.
Test: ./gradlew navigation:navigation-runtime:cC
Bug: 257514373
Change-Id: I2d1c78d459ac3efce485f0b1113cac3348e0cde9
M navigation/navigation-common/src/androidTest/java/androidx/navigation/NavGraphAndroidTest.kt
M navigation/navigation-common/src/main/java/androidx/navigation/NavGraph.kt
M navigation/navigation-runtime/src/androidTest/java/androidx/navigation/NavControllerRouteTest.kt
M navigation/navigation-runtime/src/main/java/androidx/navigation/NavController.kt
https://android-review.googlesource.com/2396200
Branch: androidx-main
commit 8bac1f9b2b66fbd29277b14bb16cc586c05969ac
Author: Clara Fok <clarafok@google.com>
Date: Thu Jan 19 10:46:44 2023
Updated findDestination and findNode for routes
NavController.findDestination(route) and NavGraph.findNode(route) maintains original behavior of first finding based on route converted to destinationId. But if that fails, it will search based on NavDestination.matchDeepLink.
Refactored existing test toStringStartDestInNodesRouteWithID because it now properly matches with the startDestination.
Test: ./gradlew navigation:navigation-runtime:cC
Bug: 257514373
Change-Id: I2d1c78d459ac3efce485f0b1113cac3348e0cde9
M navigation/navigation-common/src/androidTest/java/androidx/navigation/NavGraphAndroidTest.kt
M navigation/navigation-common/src/main/java/androidx/navigation/NavGraph.kt
M navigation/navigation-runtime/src/androidTest/java/androidx/navigation/NavControllerRouteTest.kt
M navigation/navigation-runtime/src/main/java/androidx/navigation/NavController.kt
cl...@google.com <cl...@google.com> #12
This has been fixed internally and will be available in navigation 2.6.0-alpha05
pr...@google.com <pr...@google.com> #13
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.navigation:navigation-common:2.6.0-alpha05
androidx.navigation:navigation-runtime:2.6.0-alpha05
hu...@lunabee.com <hu...@lunabee.com> #14
Hi, If we have a NavHost like this:
val route = "home?opt={argOpt}"
NavHost(navController = navController, startDestination = route) {
composable(
route = route,
arguments = listOf(
navArgument("opt") {
type = NavType.StringType
nullable = true
defaultValue = null
},
),
)
}
The following methods don't work:
navController.getBackStackEntry("home") // or "home?" or "home?opt=" <- Lead to crash
navController.popBackStack("home", false) } // or "home?" or "home?opt=" <- ignore navigation
However, if we put a default value different than null
, it's working.
Is it possible to popback
to a destination with a default value set to null
?
il...@google.com <il...@google.com> #15
Re "home"
and "home?opt=null"
should work.
Description
Currently, the Navigation APIs that take routes actually use something that is more like a route pattern without any specific arguments that could be used to differentiate the routes. So when you call
getBackStackEntry(route)
orpopBackStack(route)
navigation cannot differentiate between two destinations that may have the same route pattern, but with different arguments.We could add other APIs that take a route pattern instead that maintains the old behavior and change the current APIs to consider the exact route. This would allow Navigation to differentiate between destinations with the same route pattern and different arguments.