Fixed
Status Update
Comments
jb...@google.com <jb...@google.com> #2
Hi. Thanks for reporting this. Fixed in alpha-04
[Deleted User] <[Deleted User]> #3
Project: platform/frameworks/support
Branch: androidx-main
commit e782987543a9f8ccd485e970ddc74564b24378db
Author: Vighnesh Raut <vighnesh.raut13@gmail.com>
Date: Mon Jan 02 15:27:40 2023
fix: tab row crashes when only 1 tab is added
Bug: b/264018028
Test: Added unit test
Change-Id: I6381dbac304fc1d69d3708c6655f8b595668e93f
M tv/tv-material/src/androidTest/java/androidx/tv/material/TabRowTest.kt
M tv/tv-material/src/main/java/androidx/tv/material/TabRow.kt
https://android-review.googlesource.com/2373449
Branch: androidx-main
commit e782987543a9f8ccd485e970ddc74564b24378db
Author: Vighnesh Raut <vighnesh.raut13@gmail.com>
Date: Mon Jan 02 15:27:40 2023
fix: tab row crashes when only 1 tab is added
Bug:
Test: Added unit test
Change-Id: I6381dbac304fc1d69d3708c6655f8b595668e93f
M tv/tv-material/src/androidTest/java/androidx/tv/material/TabRowTest.kt
M tv/tv-material/src/main/java/androidx/tv/material/TabRow.kt
[Deleted User] <[Deleted User]> #4
deleted
ap...@google.com <ap...@google.com> #5
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.tv:tv-material:1.0.0-alpha04
Description
Artifact used: androidx.navigation:navigation-fragment-ktx:2.3.4
Version used: 2.3.4
Theme used: N/A
Devices/Android versions reproduced on: Any
Problem
We have the following navigation graph:
Here are declared two deep links patterns:
myapp://profiles/{userId}/
myapp://profiles/{userId}/details/
But the second deep link will never be handled because these deep links are "equal" for navigation when it tries to find the best matching deep link. In this case, NavGraph will always use first matching NavDestination (profileFragment).
For example link
myapp://profiles/u2/details/
will be handled asmyapp://profils/{userId}/
whereuserId = u2/details
.There is a workaround - remove ending slash in second pattern to make patterns tails not matching:
myapp://profiles/{userId}/
myapp://profiles/{userId}/details
It works but it is not obvious.
Purposed solution
Make arguments to not include
/
character.In resulting regexp:
^\Qmyapp://profiles/\E(.+?)\Q/\E($|(\?(.)*))
Replace:
(.+?)
With:
([^/]+?)
If this solution is right, I can create pull request on GitHub.