I have an app with the following architecture:
Navigator
is a custom class that holds theNavController
Cooridnator
holds theNavigator
Cooridnator
tells theNavigator
to "start" the framgent and passes theViewModel
to itNavigator
asksNavController
to navigateTo aNavDirections
and provides the required arguments (using Safe-Args)
Now the issue here is that if I want to send the ViewModel
as argument, it needs to be Parcelable and all of its underlying classes as well (which would make most of my code Parcelable, and that's not really needed).
So is there a way to do this without making everything Parcelable or using Dagger ? (Don't like Dagger as it adds too much complexity to the code...)
I would be okay with having a lateinit
field in the Fragment and setting it manually but can't seem to access the Fragment from NavDirections
Any idea on how I could do this ?