Fixed
Status Update
Comments
il...@google.com <il...@google.com>
ap...@google.com <ap...@google.com> #2
alpha01? That's so old! :D
We've found the issue in alpha10 and are working on a fix.
We've found the issue in alpha10 and are working on a fix.
il...@google.com <il...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 37ed64d4de87bd4a4365f5c0dfee7b33c8043013
Author: Daniel Santiago Rivera <danysantiago@google.com>
Date: Wed Jan 23 15:46:00 2019
Add missing import of parent Directions class in generated Safe Args.
When generating a parent direction action method in a child directions
class,correctly import the parent direction if its located in another
package. Both JavaPoet and KotlinPoet generate import statements but the
NavWriters were incorrectly creating the class name of the parent type,
specifically it missed the package name which caused the import to be
missing.
Bug: 123307342
Test: ./gradlew navigation:navigation-safe-args-gradle-plugin:test \
navigation:navigation-safe-args-generator:test
Change-Id: Ibeda7a7ec6f31bb1c860dfe1f5cd2a7e7ea6d47d
M navigation/safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/java/JavaNavWriter.kt
M navigation/safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/kotlin/KotlinNavWriter.kt
M navigation/safe-args-generator/src/tests/kotlin/androidx/navigation/safe/args/generator/NavGeneratorTest.kt
M navigation/safe-args-generator/src/tests/kotlin/androidx/navigation/safe/args/generator/NavParserTest.kt
M navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested/LoginFragmentDirections.java
M navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested/RegisterFragmentDirections.java
M navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested_overridden_action/InnerSettingsFragmentDirections.java
M navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested_overridden_action/SettingsFragmentDirections.java
M navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/kotlin/nested/LoginFragmentDirections.kt
M navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/kotlin/nested/RegisterFragmentDirections.kt
M navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/kotlin/nested_overridden_action/InnerSettingsFragmentDirections.kt
M navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/kotlin/nested_overridden_action/SettingsFragmentDirections.kt
M navigation/safe-args-generator/src/tests/test-data/nested_login_test.xml
M navigation/safe-args-gradle-plugin/src/test/test-data/app-project-kotlin/src/main/res/navigation/nav_nested_test.xml
A navigation/safe-args-gradle-plugin/src/test/test-data/app-project/src/main/res/navigation/nav_nested_test.xml
https://android-review.googlesource.com/883592
https://goto.google.com/android-sha1/37ed64d4de87bd4a4365f5c0dfee7b33c8043013
Branch: androidx-master-dev
commit 37ed64d4de87bd4a4365f5c0dfee7b33c8043013
Author: Daniel Santiago Rivera <danysantiago@google.com>
Date: Wed Jan 23 15:46:00 2019
Add missing import of parent Directions class in generated Safe Args.
When generating a parent direction action method in a child directions
class,correctly import the parent direction if its located in another
package. Both JavaPoet and KotlinPoet generate import statements but the
NavWriters were incorrectly creating the class name of the parent type,
specifically it missed the package name which caused the import to be
missing.
Bug: 123307342
Test: ./gradlew navigation:navigation-safe-args-gradle-plugin:test \
navigation:navigation-safe-args-generator:test
Change-Id: Ibeda7a7ec6f31bb1c860dfe1f5cd2a7e7ea6d47d
M navigation/safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/java/JavaNavWriter.kt
M navigation/safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/kotlin/KotlinNavWriter.kt
M navigation/safe-args-generator/src/tests/kotlin/androidx/navigation/safe/args/generator/NavGeneratorTest.kt
M navigation/safe-args-generator/src/tests/kotlin/androidx/navigation/safe/args/generator/NavParserTest.kt
M navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested/LoginFragmentDirections.java
M navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested/RegisterFragmentDirections.java
M navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested_overridden_action/InnerSettingsFragmentDirections.java
M navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/java/nested_overridden_action/SettingsFragmentDirections.java
M navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/kotlin/nested/LoginFragmentDirections.kt
M navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/kotlin/nested/RegisterFragmentDirections.kt
M navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/kotlin/nested_overridden_action/InnerSettingsFragmentDirections.kt
M navigation/safe-args-generator/src/tests/test-data/expected/nav_generator_test/kotlin/nested_overridden_action/SettingsFragmentDirections.kt
M navigation/safe-args-generator/src/tests/test-data/nested_login_test.xml
M navigation/safe-args-gradle-plugin/src/test/test-data/app-project-kotlin/src/main/res/navigation/nav_nested_test.xml
A navigation/safe-args-gradle-plugin/src/test/test-data/app-project/src/main/res/navigation/nav_nested_test.xml
Description
Version used: 1.0.0-beta01
When using an argType="reference" type, only valid resource values are allowed for the android:defaultValue - using @null or 0 doesn't work (both for Safe Args and at runtime).
It would be nice to have a default value available for resource types that would, at runtime, translate to a value of 0. Since would allow you to have optional resource IDs.