Class DefaultViewModelFactories
- java.lang.Object
-
- dagger.hilt.android.internal.lifecycle.DefaultViewModelFactories
-
public final class DefaultViewModelFactories extends java.lang.Object
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
Nested Classes Modifier and Type Class Description static interface
DefaultViewModelFactories.ActivityEntryPoint
The activity entry point to retrieve the factory.static interface
DefaultViewModelFactories.FragmentEntryPoint
The fragment entry point to retrieve the factory.static class
DefaultViewModelFactories.InternalFactoryFactory
Internal factory for the Hilt ViewModel Factory.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static 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 Detail
-
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!
-
-