Is it possible to use the new Navigation Architecture Component with DialogFragment? Do I have to create a custom Navigator?
I would love to use them with the new fe
No, as of the 1.0.0-alpha01
build, there is no support for dialogs as part of your Navigation Graph. You should just continue to use show() to show a DialogFragment
.
Updated for:
implementation "androidx.navigation:navigation-ui-ktx:2.2.0-rc04"
And use in my_nav_graph.xml
<dialog
android:id="@+id/my_dialog"
android:name="com.example.ui.MyDialogFragment"
tools:layout="@layout/my_dialog" />
Yes it is possible, You can access view of parent fragment from dialog fragment by calling getParentFragment().getView() . And use the view for navigation.
Here is the example
Navigation.findNavController(getParentFragment().getView()).navigate(R.id.nextfragment);
Yes, It is possible now. In it's initial release it wasn't possible but now from "androidx.navigation:navigation-fragment:2.1.0-alpha03" this navigation version you can use dialog fragment in navigation component.
Check this out:- Naviagtion dialog fragment support