Java Code Examples for android.arch.lifecycle.ViewModelProvider#Factory

The following examples show how to use android.arch.lifecycle.ViewModelProvider#Factory . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PresenterModule.java    From leanback-showcase with Apache License 2.0 5 votes vote down vote up
@PerFragment
@Provides
public LiveDataRowPresenter provideLiveDataRowPresenter(ViewModelProvider.Factory factory,
        DataLoadedListener activity) {
    LiveDataRowPresenter rowPresenter = new LiveDataRowPresenter(factory);

    rowPresenter.registerDataLoadedListener(activity);
    return rowPresenter;
}
 
Example 2
Source File: LoginActivityModule.java    From triviums with MIT License 4 votes vote down vote up
@Provides
ViewModelProvider.Factory provideViewModelProvider(LoginActivityViewModel viewModel){
    return new ViewModelProviderFactory<>(viewModel);
}
 
Example 3
Source File: LiveDataRowPresenter.java    From leanback-showcase with Apache License 2.0 4 votes vote down vote up
public LiveDataRowPresenter(ViewModelProvider.Factory factory) {
    super();
    mDataLoadedListeners = new ArrayList<>();
    viewModelFactory = factory;
}
 
Example 4
Source File: ViewModelModule.java    From leanback-showcase with Apache License 2.0 4 votes vote down vote up
@Binds
@Singleton
abstract ViewModelProvider.Factory bindViewModelFactory(ViewModelFactory factory);
 
Example 5
Source File: ViewModelFactoryModule.java    From MVVMArms with Apache License 2.0 4 votes vote down vote up
@Binds
abstract ViewModelProvider.Factory bindViewModelFactory(ViewModelFactory factory);
 
Example 6
Source File: ViewModelModule.java    From AndroidBlueprints with Apache License 2.0 4 votes vote down vote up
@Binds
abstract ViewModelProvider.Factory bindViewModelFactory(ViewModelFactory factory);
 
Example 7
Source File: ViewModelModule.java    From mvvm-template with GNU General Public License v3.0 4 votes vote down vote up
@Binds
abstract ViewModelProvider.Factory bindViewModelFactory(GithubViewModelFactory factory);
 
Example 8
Source File: ViewModelModule.java    From firestore-android-arch-components with Apache License 2.0 4 votes vote down vote up
@Binds
abstract ViewModelProvider.Factory bindViewModelFactory(ViewModelFactory factory);
 
Example 9
Source File: SplashScreenActivityModule.java    From triviums with MIT License 4 votes vote down vote up
@Provides
ViewModelProvider.Factory provideViewModelProvider(SplashScreenViewModel viewModel){
    return new ViewModelProviderFactory<>(viewModel);
}
 
Example 10
Source File: SceneViewModelProviders.java    From scene with Apache License 2.0 4 votes vote down vote up
@MainThread
public static ViewModelProvider of(@NonNull Scene scene, @NonNull ViewModelProvider.Factory factory) {
    return new ViewModelProvider(scene.getViewModelStore(), factory);
}
 
Example 11
Source File: ProfileFragmentModule.java    From triviums with MIT License 4 votes vote down vote up
@Provides
ViewModelProvider.Factory provideViewModelProvider(ProfileViewModel viewModel){
    return new ViewModelProviderFactory<>(viewModel);
}
 
Example 12
Source File: QuestionFragmentModule.java    From triviums with MIT License 4 votes vote down vote up
@Provides
//@Named("QuestionFragment")
ViewModelProvider.Factory provideViewModelProvider(QuestionViewModel viewModel){
    return new ViewModelProviderFactory<>(viewModel);
}
 
Example 13
Source File: StagesFragmentModule.java    From triviums with MIT License 4 votes vote down vote up
@Provides
ViewModelProvider.Factory provideViewModelProvider(StagesViewModel viewModel){
    return new ViewModelProviderFactory<>(viewModel);
}
 
Example 14
Source File: CategoryFragmentModule.java    From triviums with MIT License 4 votes vote down vote up
@Provides
ViewModelProvider.Factory provideViewModelProvider(CategoryViewModel viewModel){
    return new ViewModelProviderFactory<>(viewModel);
}
 
Example 15
Source File: LeaderboardFragmentModule.java    From triviums with MIT License 4 votes vote down vote up
@Provides
ViewModelProvider.Factory provideViewModelProvider(LeaderboardViewModel viewModel){
    return new ViewModelProviderFactory<>(viewModel);
}
 
Example 16
Source File: OnBoardingActivityModule.java    From triviums with MIT License 4 votes vote down vote up
@Provides
ViewModelProvider.Factory provideViewModelProvider(OnBoardingViewModel viewModel){
    return new ViewModelProviderFactory<>(viewModel);
}
 
Example 17
Source File: ViewModelModule.java    From Dagger2-Sample with MIT License 4 votes vote down vote up
@Binds
abstract ViewModelProvider.Factory bindViewModelFactory(ViewModelFactory factory);
 
Example 18
Source File: AppModule.java    From WanAndroid with GNU General Public License v3.0 4 votes vote down vote up
@Singleton
@Binds
abstract ViewModelProvider.Factory provideViewModelFactory(ProjectViewModelFactory factory);
 
Example 19
Source File: LiveDataDetailFragmentSubComponent.java    From leanback-showcase with Apache License 2.0 votes vote down vote up
ViewModelProvider.Factory viewModelProviderFactory();