Last active
November 15, 2018 16:33
-
-
Save lewisevans/f5b084b571f6d66cc7dec3ff41810420 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
abstract class BaseActivity<VM : BaseViewModel> : DaggerAppCompatActivity() { | |
@Inject | |
internal lateinit var viewModelFactory: ViewModelFactory<VM> | |
protected lateinit var viewModel:VM | |
internal inline fun <reified VM : ViewModel> viewModelWith(act: FragmentActivity): VM = | |
ViewModelProviders.of(act, viewModelFactory).get(VM::class.java) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment