Fixed
Status Update
Comments
yu...@gmail.com <yu...@gmail.com> #2
Please include a sample project that reproduces your issue.
il...@google.com <il...@google.com> #3
il...@google.com <il...@google.com> #4
Maybe it is the same as the other issue I listed? Different use case but same root cause?
ap...@google.com <ap...@google.com> #5
Switching to Kotlin Safe Args fixed the issue, so seems like the same issue, just on the Directions side (vs the other which is on the Args side).
jb...@google.com <jb...@google.com> #6
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 2180ea57914af961d4f2bb43802b42ae0d1802e0
Author: Jeremy Woods <jbwoods@google.com>
Date: Fri Oct 04 16:02:03 2019
Generate default values for Directions safe_args in Java
Currently the safe args generation for java code does not contain
default Direction args values. The default directions arg values are
provided by the Kotlin safe args generation and we should be as
uniform as possible across both languages.
Test: ./gradlew --rerun-tasks navigation:navigation-safe-args-gradle-plugin:test
Change-Id: I07b67d9c86dafff608df49a609796a71a9b3315a
navigation:navigation-safe-args-generator:test
BUG: 141099045
M navigation/navigation-safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/java/JavaNavWriter.kt
M navigation/navigation-safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/java/JavaTypes.kt
M navigation/navigation-safe-args-generator/src/tests/test-data/expected/java_nav_writer_test/MainFragmentArgs.java
M navigation/navigation-safe-args-generator/src/tests/test-data/expected/java_nav_writer_test/MainFragmentDirections.java
M navigation/navigation-safe-args-generator/src/tests/test-data/expected/java_nav_writer_test/Next.java
M navigation/navigation-safe-args-generator/src/tests/test-data/expected/java_nav_writer_test/SanitizedMainFragmentDirections.java
M navigation/navigation-safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested_overridden_action/SettingsDirections.java
M navigation/navigation-safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested_same_action/SettingsDirections.java
M navigation/navigation-safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested_same_action/SettingsFragmentDirections.java
https://android-review.googlesource.com/1133433
https://goto.google.com/android-sha1/2180ea57914af961d4f2bb43802b42ae0d1802e0
Branch: androidx-master-dev
commit 2180ea57914af961d4f2bb43802b42ae0d1802e0
Author: Jeremy Woods <jbwoods@google.com>
Date: Fri Oct 04 16:02:03 2019
Generate default values for Directions safe_args in Java
Currently the safe args generation for java code does not contain
default Direction args values. The default directions arg values are
provided by the Kotlin safe args generation and we should be as
uniform as possible across both languages.
Test: ./gradlew --rerun-tasks navigation:navigation-safe-args-gradle-plugin:test
Change-Id: I07b67d9c86dafff608df49a609796a71a9b3315a
navigation:navigation-safe-args-generator:test
BUG: 141099045
M navigation/navigation-safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/java/JavaNavWriter.kt
M navigation/navigation-safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/java/JavaTypes.kt
M navigation/navigation-safe-args-generator/src/tests/test-data/expected/java_nav_writer_test/MainFragmentArgs.java
M navigation/navigation-safe-args-generator/src/tests/test-data/expected/java_nav_writer_test/MainFragmentDirections.java
M navigation/navigation-safe-args-generator/src/tests/test-data/expected/java_nav_writer_test/Next.java
M navigation/navigation-safe-args-generator/src/tests/test-data/expected/java_nav_writer_test/SanitizedMainFragmentDirections.java
M navigation/navigation-safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested_overridden_action/SettingsDirections.java
M navigation/navigation-safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested_same_action/SettingsDirections.java
M navigation/navigation-safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested_same_action/SettingsFragmentDirections.java
yu...@gmail.com <yu...@gmail.com> #7
This has been fixed internally and will be available in the Navigation 2.2.0-beta01 release.
yu...@gmail.com <yu...@gmail.com> #8
Using '2.2.0-rc02'. Putting null as a default value for a string, returns a string "@null" when getting that parameter from navArgs
<argument
android:name="deepLinkToken"
android:defaultValue="@null"
app:argType="string"
app:nullable="true" />
And:
val args by navArgs<FragmentArgs>()
args.deepLinkToken // returns "@null"
<argument
android:name="deepLinkToken"
android:defaultValue="@null"
app:argType="string"
app:nullable="true" />
And:
val args by navArgs<FragmentArgs>()
args.deepLinkToken // returns "@null"
yu...@gmail.com <yu...@gmail.com> #9
Re #8 - please file a separate bugs with a project that reproduce your separate issue. If the issue you are mentioning is covered by https://issuetracker.google.com/issues/141613546 , feel free to +1.
Description
Component used: Navigation Version used: Snapshot #7634339 or 2.4.0-alpha07 Devices/Android versions reproduced on: Pixel 4a
This issue is related to another fixed issue: https://issuetracker.google.com/issues/194925622
2.4.0-alpha05 introduced a bug where tab reselection causes empty screens, unless the current screen is the
startDestination
of the root graph.The issue was fixed in Snapshot #7634339 , but it introduced another bug:
Flows collected in compose screens via
rememberFlowWithLifecycle(flow).collectAsState(initial)
complete early on tab reselection, like in the original issue. AboutrememberFlowWithLifecycle
Attaching the minimal sample that shows the problem and a video.
In sample view model, there is a simple flow that emits text in some interval.
In 2.4.0-alpha04 - Collecting flows directly via collectAsState or via rememberFlowWithLifecycle works as expected (interval Flow doesn't complete until the user leaves the screen)
In 2.4.0-alpha05-06 - Screen becomes empty on tab reselection
In Snapshot #7634339 / 2.4.0-alpha07:
rememberFlowWithLifecycle