Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
/** Represents Module for Test Management
* @author Aveek
* @author
* @version 1
* @since 4.4.0 - Version
internal class TestModule (val context : TestManagement) {
* provides viewModel of the XML
* @param repository is containing the Repository instance which we need to call api from viewmodel
* @return Instance of ViewModel
* Since ViewModelProviders only accepts non-zero argument as parameter
* we had to make a Factory method to override the default behavior and accepts repository as @param
fun viewModel(repository: CustomRepository): TestManagementVM = ViewModelProviders.of(context, TestManagementVMFactory(repository)).get(
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment