Hey there. I am really new to your site but have found it very impressive so far. At any rate, I was (am) trying to get this tutorial to work to aid me in adding DialogFragment
s to my app that already has a nav_graph
.
I ran into two issues:
(1) AuthorDetailsNavigator.kt:
Class āAuthorDetailsNavigatorā is not abstract and does not implement abstract base class member @Nullable public abstract fun navigate(@NonNull destination: AuthorDetailsNavigator.Destination, @Nullable args: Bundle?, @Nullable navOptions: NavOptions?, @Nullable navigatorExtras: Navigator.Extras?): NavDestination? defined in androidx.navigation.Navigator
If I [Alt-Enter] and [Implement members] and select [navigate], the error goes away. I changed your (original)
override fun navigate(destination: Destination, args: Bundle?, navOptions: NavOptions?) {
val dialog = AuthorDetailsDialog()
dialog.arguments = args
dialog.show(manager, AuthorDetailsDialog.TAG)
}
to
override fun navigate(destination: Destination, args: Bundle?, navOptions: NavOptions?, navigatorExtras: Extras?): NavDestination? {
return NavDestination(this)
}
Does that seem correct? And, if so, are any of the other routines in this class no longer needed?
(2) MainActivity.kt:
Unresolved reference: onHandleDeepLink twice
I made the change mentioned above for (1) and commented out the two offending lines in (2) and the app compiles and runs fine.
Except that Iām not seeing the AuthorDetails DialogFragment
, which was (is) my whole purpose in undertaking this exercise.
Any thoughts?
Note: I have some āproject differencesā from your original source. Notably:
- gradle/wrapper/gradle-wrapper.properties ā distā¦Url=ā¦gradle-4.10.1-all.zip (not ā4.6ā)
- app/build.gradle ā implā¦arch.navigation:navigation-fragment-ktx:1.0.0" (no ā-alpha05ā)
- app/build.gradle ā implā¦arch.navigation:navigation-ui-ktx:1.0.0" (no ā-alpha05ā)
Thanks.