Isaac Udy
07/16/2020, 10:53 AM@Assisted
injected parameters to a class that is using @ViewModelInject
?flosch
07/16/2020, 10:58 AMIsaac Udy
07/16/2020, 11:10 AM@Inject
constructor, and write a custom ViewModelFactory that builds the ViewModelComponent and provides the SavedState/Navigation Handle classes into that component to be injected into the ViewModel's @Inject
constructor via the Dagger component defined in the library user's application.
Does that make sense? A lot of information to dump, sorry.
I can't figure out how to do something similar using Hilt.@Assisted
annotation. I have an object that also needs to be available in the ViewModel, and also requires a soft reference to the activity, but I can't figure out how to mimic the SavedStateHandle's method of injection (because this appears to be tied up in final library classes in Hilt)