Feature Request P4
Status Update
Comments
il...@google.com <il...@google.com> #2
You can still use child Fragments with navigation. What was wrong with your previous approach?
al...@gmail.com <al...@gmail.com> #3
If I call navigate(FragmentDirections.dialog()), the dialog will be added to the nav host fragment's FM. The point is that I don't want to have to manually do a fragment transaction with my fragment's FM.
il...@google.com <il...@google.com> #4
Does dialog.show(childFragmentManager()) really count as 'manually doing a fragment transaction'? :)
Is there a particular reason you're using an <include> here vs just a nested graph as an inline <navigation> element? We certainly generate Safe Args within the same file.
It would be helpful if you could include a sample project that reproduces your issue.
Is there a particular reason you're using an <include> here vs just a nested graph as an inline <navigation> element? We certainly generate Safe Args within the same file.
It would be helpful if you could include a sample project that reproduces your issue.
al...@gmail.com <al...@gmail.com> #5
Yes, it does:
companion object {
private const val TAG = "MoveConfirmationDialog"
private const val DEVICE_COUNT_KEY = "device_count"
private const val RESPONSE_KEY = "validation_response"
private const val GROUP_NAME_KEY = "group_name"
fun show(
manager: FragmentManager,
group: Group,
devices: List<Device>,
validation: MoveValidationResponse
) {
MoveConfirmationDialog().apply {
arguments = bundleOf(
DEVICE_COUNT_KEY to devices.size,
GROUP_NAME_KEY to group,
RESPONSE_KEY to validation
)
}.show(manager, TAG)
}
}
-------------------
Once you try safe args, you can't go back. 😁 And no, I didn't know the plugin would work with inline navigation tags! I'll try that tomorrow and report back. Do you still want a sample for the cross-graph bug?
companion object {
private const val TAG = "MoveConfirmationDialog"
private const val DEVICE_COUNT_KEY = "device_count"
private const val RESPONSE_KEY = "validation_response"
private const val GROUP_NAME_KEY = "group_name"
fun show(
manager: FragmentManager,
group: Group,
devices: List<Device>,
validation: MoveValidationResponse
) {
MoveConfirmationDialog().apply {
arguments = bundleOf(
DEVICE_COUNT_KEY to devices.size,
GROUP_NAME_KEY to group,
RESPONSE_KEY to validation
)
}.show(manager, TAG)
}
}
-------------------
Once you try safe args, you can't go back. 😁 And no, I didn't know the plugin would work with inline navigation tags! I'll try that tomorrow and report back. Do you still want a sample for the cross-graph bug?
al...@gmail.com <al...@gmail.com> #6
Can confirm that using an inline <navigation> tag works. But yeah, jumping out from a separate file doesn't.
il...@google.com <il...@google.com> #7
Thanks for confirming.
If you have a small sample project that reproduces your original issue, that'd be really useful.
If you have a small sample project that reproduces your original issue, that'd be really useful.
Description
Version used: 2.1.0-alpha04
I've been down a nasty rabbit hole, but here's what I'm actually trying to do. Basically, I want a view model scoped to _only_ a fragment and its dialogs. I used to be able to do this super easily with requireParentFragment() (aka scoping dialog view models to their owner fragments) but that doesn't work anymore since the parent is the nav host.
So now, I'm trying to create a nested graph with just the fragment and its dialogs. That should work, except it doesn't when trying to jump out of the graph because the safe args plugin doesn't generate args outside of the graph.
Here's what I mean:
1. Create graph with <include ...> destination
2. In that graph, create action with destination in original graph
3. Add some args to the destination in the original graph
4. The safe args plugin generates a link, but with no args