Skip to content

Instantly share code, notes, and snippets.

@kishansinhparmar
Created July 19, 2019 05:17
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 kishansinhparmar/35e1c4a861c4bb23fa38ba91ebf48626 to your computer and use it in GitHub Desktop.
Save kishansinhparmar/35e1c4a861c4bb23fa38ba91ebf48626 to your computer and use it in GitHub Desktop.
This template will inflate and initialize common code.
binding = DataBindingUtil.inflate(inflater, R.layout.$layout_file$, container, false)
val vm by lazy {
ViewModelProviders.of(this, $VIEWMODEL_CLASS$Factory(repo))
.get($VIEWMODEL_CLASS$::class.java)
}
binding.$VIEWMODEL_VARIABLE_NAME_FROM_XML$ = vm
binding.lifecycleOwner = this
return binding.root
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment