Class DefaultViewModelFactories
java.lang.Object
dagger.hilt.android.internal.lifecycle.DefaultViewModelFactories
Modules and entry points for the default view model factory used by activities and fragments
annotated with @AndroidEntryPoint.
Entry points are used to acquire the factory because injected fields in the generated activities and fragments are ignored by Dagger when using the transform due to the generated class not being part of the hierarchy during compile time.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
The activity entry point to retrieve the factory.static interface
The fragment entry point to retrieve the factory.static final class
Internal factory for the Hilt ViewModel Factory. -
Method Summary
Modifier and TypeMethodDescriptionstatic androidx.lifecycle.ViewModelProvider.Factory
getActivityFactory
(androidx.activity.ComponentActivity activity, androidx.lifecycle.ViewModelProvider.Factory delegateFactory) Retrieves the default view model factory for the activity.static androidx.lifecycle.ViewModelProvider.Factory
getFragmentFactory
(androidx.fragment.app.Fragment fragment, androidx.lifecycle.ViewModelProvider.Factory delegateFactory) Retrieves the default view model factory for the activity.
-
Method Details
-
getActivityFactory
public static androidx.lifecycle.ViewModelProvider.Factory getActivityFactory(androidx.activity.ComponentActivity activity, androidx.lifecycle.ViewModelProvider.Factory delegateFactory) Retrieves the default view model factory for the activity.Do not use except in Hilt generated code!
-
getFragmentFactory
public static androidx.lifecycle.ViewModelProvider.Factory getFragmentFactory(androidx.fragment.app.Fragment fragment, androidx.lifecycle.ViewModelProvider.Factory delegateFactory) Retrieves the default view model factory for the activity.Do not use except in Hilt generated code!
-