Fixed
Status Update
Comments
wk...@google.com <wk...@google.com> #2
I don't think #1 makes a lot of sense. There are already potentially libraries out there without that metadata.
#2 makes the most sense to me, but in case we cannot be 100% reliable we should allow blacklisting libraries as described in #3. This should probably be handled globally for a project (in gradle.properpies rather than in the DSL)
#2 makes the most sense to me, but in case we cannot be 100% reliable we should allow blacklisting libraries as described in #3. This should probably be handled globally for a project (in gradle.properpies rather than in the DSL)
il...@google.com <il...@google.com> #3
As I have mentioned I don't think there is a silver bullet. #2 does not work on 100% and #1 will take time before devs will provide the metadata. #3 is in my opinion very important to introduce asap, as the developers have no way how to workaround it at this stage. Also in the future there can be any other issue and there is nothing wrong in doing #3 until we figure out something robust (or for instance finally migrate work manager and navigation to androidx that would make #2 a feasible solution).
Description
Navigation Arch component and Safe Args Plugin versions 1.0.0-alpha02, 1.0.0-alpha04
Device: Samsung Galaxy S6
I have an argument for activity or fragment when using Navigation Arch component
<argument
android:name="EXTRA_INTEGER"
app:argType="reference"
android:defaultValue="@integer/integer_value"/>
where @integer/integer_value is: <item name="integer_value" format="integer" type="integer">-1</item>
When it navigates with code:
NavHostFragment.findNavController(this).navigate(R.id.action_openFragment)
the value of arguments or intent extra becomes equal -1 (arguments.getInt("EXTRA_INTEGER") or intent.getIntExtra("EXTRA_INTEGER"))
When I use Safe Args plugin generated class
NavHostFragment.findNavController(this).navigate(MyFragmentDirections.actionOpenFragment())
it turns out to be equal reference itself (e.g. 2131296267)
It is an inconsistent behavior and should be fixed in one or another way