Search in sources :

Example 1 with OpenSourceViewModel

use of com.mindorks.framework.mvvm.ui.feed.opensource.OpenSourceViewModel in project android-mvvm-architecture by MindorksOpenSource.

the class FragmentModule method provideOpenSourceViewModel.

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

Aggregations

ViewModelProvider (androidx.lifecycle.ViewModelProvider)1 ViewModelProviderFactory (com.mindorks.framework.mvvm.ViewModelProviderFactory)1 OpenSourceViewModel (com.mindorks.framework.mvvm.ui.feed.opensource.OpenSourceViewModel)1 Provides (dagger.Provides)1