Last active
November 1, 2019 02:33
-
-
Save NsAveek/415b83933176099deb6da7a799a1aa15 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Represents Module for Test Management | |
* @author Aveek | |
* @author www.myproject.com | |
* @version 1 | |
* @since 4.4.0 - Version | |
*/ | |
@Module | |
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 | |
*/ | |
@Provides | |
@ActivityScope | |
fun viewModel(repository: CustomRepository): TestManagementVM = ViewModelProviders.of(context, TestManagementVMFactory(repository)).get(TestManagementVM::class.java) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment