Skip to content

Instantly share code, notes, and snippets.

@Nimrodda
Last active February 26, 2020 21:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Nimrodda/054b60f3b87d37717640ec69e51f6786 to your computer and use it in GitHub Desktop.
Save Nimrodda/054b60f3b87d37717640ec69e51f6786 to your computer and use it in GitHub Desktop.
class DetailViewModelFactory(
private val githubApi: GithubApi,
owner: SavedStateRegistryOwner,
defaultArgs: Bundle? = null
) : AbstractSavedStateViewModelFactory(owner, defaultArgs) {
override fun <T : ViewModel> create(
key: String,
modelClass: Class<T>,
handle: SavedStateHandle
): T {
return DetailViewModel(githubApi, handle) as T
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment