Fixed
Status Update
Comments
il...@google.com <il...@google.com>
il...@google.com <il...@google.com> #2
Only the `argType="reference"` accepts resource IDs (and returns an int that you'd pass to getContext().getString()), so it is working as intended that a "string" type is exactly what you put into your XML. It was important that the build time code gen and the runtime behavior always matches and that was not possible in the general cases - see edge cases such as https://issuetracker.google.com/issues/111736515 for some background.
Please starhttps://issuetracker.google.com/issues/36994900 to track progress towards allowing placeholders in XML files, which would be the recommended way of filling in placeholders at compile time.
Please star
il...@google.com <il...@google.com> #3
Ok thanks, I understand now, I wasn't aware of argType="reference". Anyway I think it is a bit strange that behavior is different if we navigate using safe args gen code (navController.navigate(WebPageFragmentDirections.actionGlobalHomeFragment())) and code without safe args (navController.navigate(R.id.homeFragment)) if the navigation xml file is the same.
il...@google.com <il...@google.com> #4
Yes, I think we can make it more explicit that only reference types can have references to other resources.
Description
Version used: 1.0.0-alpha09
Would be nice to have an easier way to access the Args class since the getArguments() of a Fragment or getIntent().getExtras() of an Activity aren't available at construction time, meaning you need to use a lazy property delgate.
Wrapping that up in a type safe way that works with the generated Args classes would be greatly preferable.