Search in sources :

Example 1 with AboutViewModel

use of com.mindorks.framework.mvvm.ui.about.AboutViewModel in project android-mvvm-architecture by MindorksOpenSource.

the class FragmentModule method provideAboutViewModel.

@Provides
AboutViewModel provideAboutViewModel(DataManager dataManager, SchedulerProvider schedulerProvider) {
    Supplier<AboutViewModel> supplier = () -> new AboutViewModel(dataManager, schedulerProvider);
    ViewModelProviderFactory<AboutViewModel> factory = new ViewModelProviderFactory<>(AboutViewModel.class, supplier);
    return new ViewModelProvider(fragment, factory).get(AboutViewModel.class);
}
Also used : ViewModelProviderFactory(com.mindorks.framework.mvvm.ViewModelProviderFactory) AboutViewModel(com.mindorks.framework.mvvm.ui.about.AboutViewModel) ViewModelProvider(androidx.lifecycle.ViewModelProvider) Provides(dagger.Provides)

Aggregations

ViewModelProvider (androidx.lifecycle.ViewModelProvider)1 ViewModelProviderFactory (com.mindorks.framework.mvvm.ViewModelProviderFactory)1 AboutViewModel (com.mindorks.framework.mvvm.ui.about.AboutViewModel)1 Provides (dagger.Provides)1