Created
March 8, 2018 02:20
-
-
Save cdmunoz/8e693ea06f21bf842f48f3ff42cb1a85 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| class CryptocurrenciesViewModelFactory @Inject constructor( | |
| private val cryptocurrenciesViewModel: CryptocurrenciesViewModel) : ViewModelProvider.Factory { | |
| override fun <T : ViewModel> create(modelClass: Class<T>): T { | |
| if (modelClass.isAssignableFrom(CryptocurrenciesViewModel::class.java!!)) { | |
| return cryptocurrenciesViewModel as T | |
| } | |
| throw IllegalArgumentException("Unknown class name") | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment