Fixed
Status Update
Comments
il...@google.com <il...@google.com> #2
The sample app https://github.com/Aksi0m/SampleFor123686419 can be used, changing
<argument android:name="innerData" app:argType="com.example.sandbox.OutterClass.InnerClass"/>
to
<argument android:name="innerData" app:argType="com.example.sandbox.OutterClass$InnerClass"/>
to fix the original issue.
<argument android:name="innerData" app:argType="com.example.sandbox.OutterClass.InnerClass"/>
to
<argument android:name="innerData" app:argType="com.example.sandbox.OutterClass$InnerClass"/>
to fix the original issue.
ap...@google.com <ap...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 5c2d4bf0091caada1dbc4f0c34564e8b21a9eb42
Author: Daniel Santiago Rivera <danysantiago@google.com>
Date: Fri Feb 01 16:17:55 2019
Support parsing inner classes name as types in Safe Args.
This allows using an inner class as arg type if correctly declared using
the dollar sign, e.g. 'com.example.sandbox.OutterClass$InnerClass'.
This CL also updates the non-kotlin nav graph in the PluginTest project
to be the same as the kotlin one, giving us parity coverage for both the
kotlin and java versions of the plugin.
Bug: 123736741
Test: ./gradlew navigation:navigation-safe-args-gradle-plugin:test \
navigation:navigation-safe-args-generator:test
Change-Id: Ie91ffd0903af7df9b2944f586e3cbbc03ec57bd9
M navigation/safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/ext/String_ext.kt
M navigation/safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/java/JavaTypes.kt
M navigation/safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/kotlin/KotlinTypes.kt
M navigation/safe-args-generator/src/tests/kotlin/androidx/navigation/safe/args/generator/JavaNavWriterTest.kt
M navigation/safe-args-generator/src/tests/kotlin/androidx/navigation/safe/args/generator/KotlinNavWriterTest.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/java_nav_writer_test/Next.java
M navigation/safe-args-generator/src/tests/test-data/expected/kotlin_nav_writer_test/Next.kt
M navigation/safe-args-generator/src/tests/test-data/naive_test.xml
M navigation/safe-args-gradle-plugin/src/test/kotlin/androidx/navigation/safeargs/gradle/PluginTest.kt
M navigation/safe-args-gradle-plugin/src/test/test-data/app-project-kotlin/src/main/java/androidx/navigation/testapp/MyClass.kt
M navigation/safe-args-gradle-plugin/src/test/test-data/app-project-kotlin/src/main/res/navigation/nav_test.xml
M navigation/safe-args-gradle-plugin/src/test/test-data/app-project/src/main/AndroidManifest.xml
A navigation/safe-args-gradle-plugin/src/test/test-data/app-project/src/main/java/androidx/navigation/testapp/MyClass.java
A navigation/safe-args-gradle-plugin/src/test/test-data/app-project/src/main/java/androidx/navigation/testapp/pkg/MyPkgClass.java
D navigation/safe-args-gradle-plugin/src/test/test-data/app-project/src/main/java/foo/Bar.java
M navigation/safe-args-gradle-plugin/src/test/test-data/app-project/src/main/res/navigation/nav_test.xml
A navigation/safe-args-gradle-plugin/src/test/test-data/app-project/src/main/res/values/colors.xml
https://android-review.googlesource.com/893040
https://goto.google.com/android-sha1/5c2d4bf0091caada1dbc4f0c34564e8b21a9eb42
Branch: androidx-master-dev
commit 5c2d4bf0091caada1dbc4f0c34564e8b21a9eb42
Author: Daniel Santiago Rivera <danysantiago@google.com>
Date: Fri Feb 01 16:17:55 2019
Support parsing inner classes name as types in Safe Args.
This allows using an inner class as arg type if correctly declared using
the dollar sign, e.g. 'com.example.sandbox.OutterClass$InnerClass'.
This CL also updates the non-kotlin nav graph in the PluginTest project
to be the same as the kotlin one, giving us parity coverage for both the
kotlin and java versions of the plugin.
Bug: 123736741
Test: ./gradlew navigation:navigation-safe-args-gradle-plugin:test \
navigation:navigation-safe-args-generator:test
Change-Id: Ie91ffd0903af7df9b2944f586e3cbbc03ec57bd9
M navigation/safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/ext/String_ext.kt
M navigation/safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/java/JavaTypes.kt
M navigation/safe-args-generator/src/main/kotlin/androidx/navigation/safe/args/generator/kotlin/KotlinTypes.kt
M navigation/safe-args-generator/src/tests/kotlin/androidx/navigation/safe/args/generator/JavaNavWriterTest.kt
M navigation/safe-args-generator/src/tests/kotlin/androidx/navigation/safe/args/generator/KotlinNavWriterTest.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/java_nav_writer_test/Next.java
M navigation/safe-args-generator/src/tests/test-data/expected/kotlin_nav_writer_test/Next.kt
M navigation/safe-args-generator/src/tests/test-data/naive_test.xml
M navigation/safe-args-gradle-plugin/src/test/kotlin/androidx/navigation/safeargs/gradle/PluginTest.kt
M navigation/safe-args-gradle-plugin/src/test/test-data/app-project-kotlin/src/main/java/androidx/navigation/testapp/MyClass.kt
M navigation/safe-args-gradle-plugin/src/test/test-data/app-project-kotlin/src/main/res/navigation/nav_test.xml
M navigation/safe-args-gradle-plugin/src/test/test-data/app-project/src/main/AndroidManifest.xml
A navigation/safe-args-gradle-plugin/src/test/test-data/app-project/src/main/java/androidx/navigation/testapp/MyClass.java
A navigation/safe-args-gradle-plugin/src/test/test-data/app-project/src/main/java/androidx/navigation/testapp/pkg/MyPkgClass.java
D navigation/safe-args-gradle-plugin/src/test/test-data/app-project/src/main/java/foo/Bar.java
M navigation/safe-args-gradle-plugin/src/test/test-data/app-project/src/main/res/navigation/nav_test.xml
A navigation/safe-args-gradle-plugin/src/test/test-data/app-project/src/main/res/values/colors.xml
il...@google.com <il...@google.com> #4
This is fixed internally and will be available in the next release of Navigation.
Description
Version used: 1.0.0-alpha11
When debugging
<argument android:name="innerData" app:argType="com.example.sandbox.OutterClass$InnerClass"/>
The dollar signs indicating a nested class are not transformed into a period in the generated code, leading to invalid code such as:
OutterClass$InnerClass innerData = (OutterClass$InnerClass) arguments.get("innerData");
Which should be
OutterClass.InnerClass innerData = (OutterClass.InnerClass) arguments.get("innerData");