Search in sources :

Example 1 with SplashViewModel

use of com.mindorks.framework.mvvm.ui.splash.SplashViewModel in project android-mvvm-architecture by MindorksOpenSource.

the class ActivityModule method provideSplashViewModel.

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

Aggregations

ViewModelProvider (androidx.lifecycle.ViewModelProvider)1 ViewModelProviderFactory (com.mindorks.framework.mvvm.ViewModelProviderFactory)1 SplashViewModel (com.mindorks.framework.mvvm.ui.splash.SplashViewModel)1 Provides (dagger.Provides)1