use of com.mindorks.framework.mvvm.ViewModelProviderFactory in project android-mvvm-architecture by MindorksOpenSource.
the class ActivityModule method provideFeedViewModel.
@Provides
FeedViewModel provideFeedViewModel(DataManager dataManager, SchedulerProvider schedulerProvider) {
Supplier<FeedViewModel> supplier = () -> new FeedViewModel(dataManager, schedulerProvider);
ViewModelProviderFactory<FeedViewModel> factory = new ViewModelProviderFactory<>(FeedViewModel.class, supplier);
return new ViewModelProvider(activity, factory).get(FeedViewModel.class);
}
use of com.mindorks.framework.mvvm.ViewModelProviderFactory in project android-mvvm-architecture by MindorksOpenSource.
the class FragmentModule method provideBlogViewModel.
@Provides
BlogViewModel provideBlogViewModel(DataManager dataManager, SchedulerProvider schedulerProvider) {
Supplier<BlogViewModel> supplier = () -> new BlogViewModel(dataManager, schedulerProvider);
ViewModelProviderFactory<BlogViewModel> factory = new ViewModelProviderFactory<>(BlogViewModel.class, supplier);
return new ViewModelProvider(fragment, factory).get(BlogViewModel.class);
}
use of com.mindorks.framework.mvvm.ViewModelProviderFactory 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);
}
use of com.mindorks.framework.mvvm.ViewModelProviderFactory 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);
}
use of com.mindorks.framework.mvvm.ViewModelProviderFactory in project android-mvvm-architecture by MindorksOpenSource.
the class ActivityModule method provideMainViewModel.
@Provides
MainViewModel provideMainViewModel(DataManager dataManager, SchedulerProvider schedulerProvider) {
Supplier<MainViewModel> supplier = () -> new MainViewModel(dataManager, schedulerProvider);
ViewModelProviderFactory<MainViewModel> factory = new ViewModelProviderFactory<>(MainViewModel.class, supplier);
return new ViewModelProvider(activity, factory).get(MainViewModel.class);
}
Aggregations