Skip to content

Navigation: Allow parsing a NavType#ReferenceType from String - #127

Closed
JvmName wants to merge 7 commits into
androidx:androidx-mainfrom
JvmName:parse-reference-navtype
Closed

JvmName wants to merge 7 commits into
androidx:androidx-mainfrom
JvmName:parse-reference-navtype

Conversation

@JvmName

@JvmName JvmName commented Feb 7, 2021

Copy link
Copy Markdown
Contributor

If Bundle contents can be extracted as a Reference, allow parsing the Bundle contents as a Reference.

When navigating via deeplink URI, the user is required to string-ify navigation arguments in order to append them to the URI as query parameters. This PR supports retrieving a Reference type from a Bundle

Proposed Changes

  • replace NavType#ReferenceType::parseValue's method functionality with Integer.parseInt

Testing

Updated NavTypeTest to validate that reference types can be inserted and retrieved from a Bundle.
Test: /gradlew test connectedCheck

Issues Fixed

Fixes: b/179166693

@google-cla google-cla Bot added the cla: yes label Feb 7, 2021
@JvmName JvmName changed the title Allow parsing a NavType#ReferenceType from String Navigation: Allow parsing a NavType#ReferenceType from String Feb 7, 2021
@dlam
dlam requested a review from jbw0033 February 8, 2021 17:21
Comment thread navigation/navigation-common/src/androidTest/res/values/ids.xml Outdated
@JvmName
JvmName requested a review from jbw0033 February 9, 2021 15:53
Comment thread navigation/navigation-common/src/main/java/androidx/navigation/NavType.java Outdated
@JvmName

JvmName commented Feb 9, 2021

Copy link
Copy Markdown
Contributor Author

Error: Unable to deliver Web Hook Error: Request failed with status code 502

Looks like some part of the build chain is having a bad day -- I'll attempt to rebuild tomorrow, but these changes compile on my local machine FWIW

@ianhanniballake

Copy link
Copy Markdown
Member

Yep, we're having some internal infrastructure fun times at the moment. Code looks good here though!

@JvmName
JvmName deleted the parse-reference-navtype branch February 10, 2021 02:34
BreezyHe pushed a commit to Tencent-TDS/ovCompose-multiplatform-core that referenced this pull request Apr 27, 2025
If Bundle contents can be extracted as a Reference, allow parsing the Bundle contents as a Reference.

When navigating via deeplink URI, the user is required to string-ify navigation arguments in order to append them to the URI as query parameters. This PR supports retrieving a Reference type from a Bundle

## Proposed Changes
  - replace `NavType#ReferenceType::parseValue`'s method functionality with `Integer.parseInt`

## Testing
Updated `NavTypeTest` to validate that reference types can be inserted and retrieved from a Bundle.
Test: /gradlew test connectedCheck

## Issues Fixed

Fixes: b/179166693

This is an imported pull request from androidx/androidx#127.

Resolves #127
Github-Pr-Head-Sha: 78179a9e7dfe156d647a7e30992fd82aaa40a7ad
GitOrigin-RevId: edf5410d3277740bdb4033bce59655e9c8df960a
Change-Id: I80f4d03a07b04756cd7ea1f3cf43688a115116e4
(cherry picked from commit 15eea2e)
harryzz pushed a commit to harryzz/compose-multiplatform-core that referenced this pull request Jul 28, 2026
If Bundle contents can be extracted as a Reference, allow parsing the Bundle contents as a Reference.

When navigating via deeplink URI, the user is required to string-ify navigation arguments in order to append them to the URI as query parameters. This PR supports retrieving a Reference type from a Bundle

## Proposed Changes
  - replace `NavType#ReferenceType::parseValue`'s method functionality with `Integer.parseInt`

## Testing
Updated `NavTypeTest` to validate that reference types can be inserted and retrieved from a Bundle.
Test: /gradlew test connectedCheck

## Issues Fixed

Fixes: b/179166693

This is an imported pull request from androidx#127.

Resolves JetBrains#127
Github-Pr-Head-Sha: 78179a9
GitOrigin-RevId: edf5410
Change-Id: I80f4d03a07b04756cd7ea1f3cf43688a115116e4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants