-
public class Mavericks
-
-
Field Summary
Fields Modifier and Type Field Description private final StringKEY_ARGprivate ViewModelDelegateFactoryviewModelDelegateFactoryprivate MavericksViewModelConfigFactoryviewModelConfigFactorypublic final static MavericksINSTANCE
-
Method Summary
Modifier and Type Method Description final Unitinitialize(Context context, MavericksViewModelConfigFactory viewModelConfigFactory, ViewModelDelegateFactory viewModelDelegateFactory)A helper for setting viewModelConfigFactory based on whether the app was built in debug mode or not. final Unitinitialize(Boolean debugMode, MavericksViewModelConfigFactory viewModelConfigFactory, ViewModelDelegateFactory viewModelDelegateFactory)A helper for setting viewModelConfigFactory with the given debug mode. final StringgetKEY_ARG()If your initial state needs to use Fragment arguments, store your arguments as a parcelable class stored at this key. final ViewModelDelegateFactorygetViewModelDelegateFactory()A factory that provides the Lazy ViewModels created for Mavericks extension functions, such as activityViewModel. final UnitsetViewModelDelegateFactory(ViewModelDelegateFactory viewModelDelegateFactory)A factory that provides the Lazy ViewModels created for Mavericks extension functions, such as activityViewModel. final MavericksViewModelConfigFactorygetViewModelConfigFactory()final UnitsetViewModelConfigFactory(MavericksViewModelConfigFactory viewModelConfigFactory)-
-
Method Detail
-
initialize
final Unit initialize(Context context, MavericksViewModelConfigFactory viewModelConfigFactory, ViewModelDelegateFactory viewModelDelegateFactory)
A helper for setting viewModelConfigFactory based on whether the app was built in debug mode or not.
-
initialize
final Unit initialize(Boolean debugMode, MavericksViewModelConfigFactory viewModelConfigFactory, ViewModelDelegateFactory viewModelDelegateFactory)
A helper for setting viewModelConfigFactory with the given debug mode.
-
getKEY_ARG
final String getKEY_ARG()
If your initial state needs to use Fragment arguments, store your arguments as a parcelable class stored at this key.
-
getViewModelDelegateFactory
final ViewModelDelegateFactory getViewModelDelegateFactory()
A factory that provides the Lazy ViewModels created for Mavericks extension functions, such as activityViewModel.
Each time a ViewModel is accessed via one of these extension functions this factory creates the Kotlin property delegate that wraps the ViewModel.
The default implementation DefaultViewModelDelegateFactory is fine for general usage, but a custom factory may be provided to assist with testing, or if you want control over how and when ViewModels and their State are created.
-
setViewModelDelegateFactory
final Unit setViewModelDelegateFactory(ViewModelDelegateFactory viewModelDelegateFactory)
A factory that provides the Lazy ViewModels created for Mavericks extension functions, such as activityViewModel.
Each time a ViewModel is accessed via one of these extension functions this factory creates the Kotlin property delegate that wraps the ViewModel.
The default implementation DefaultViewModelDelegateFactory is fine for general usage, but a custom factory may be provided to assist with testing, or if you want control over how and when ViewModels and their State are created.
-
getViewModelConfigFactory
final MavericksViewModelConfigFactory getViewModelConfigFactory()
-
setViewModelConfigFactory
final Unit setViewModelConfigFactory(MavericksViewModelConfigFactory viewModelConfigFactory)
-
-
-
-