use of com.mindorks.framework.mvvm.ViewModelProviderFactory in project android-mvvm-architecture by MindorksOpenSource.
the class ActivityModule method provideLoginViewModel.
@Provides
LoginViewModel provideLoginViewModel(DataManager dataManager, SchedulerProvider schedulerProvider) {
Supplier<LoginViewModel> supplier = () -> new LoginViewModel(dataManager, schedulerProvider);
ViewModelProviderFactory<LoginViewModel> factory = new ViewModelProviderFactory<>(LoginViewModel.class, supplier);
return new ViewModelProvider(activity, factory).get(LoginViewModel.class);
}
use of com.mindorks.framework.mvvm.ViewModelProviderFactory in project android-mvvm-architecture by MindorksOpenSource.
the class DialogModule method provideRateUsViewModel.
@Provides
RateUsViewModel provideRateUsViewModel(DataManager dataManager, SchedulerProvider schedulerProvider) {
Supplier<RateUsViewModel> supplier = () -> new RateUsViewModel(dataManager, schedulerProvider);
ViewModelProviderFactory<RateUsViewModel> factory = new ViewModelProviderFactory<>(RateUsViewModel.class, supplier);
return new ViewModelProvider(dialog.getActivity(), factory).get(RateUsViewModel.class);
}
use of com.mindorks.framework.mvvm.ViewModelProviderFactory 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);
}
Aggregations