Skip to content

Instantly share code, notes, and snippets.

@har5hit
Created July 30, 2018 07:54
Show Gist options
  • Select an option

  • Save har5hit/ffc55da87e0d028914c100b0d52912bb to your computer and use it in GitHub Desktop.

Select an option

Save har5hit/ffc55da87e0d028914c100b0d52912bb to your computer and use it in GitHub Desktop.

Revisions

  1. har5hit created this gist Jul 30, 2018.
    20 changes: 20 additions & 0 deletions Adding a ViewModel key
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    ---- JAVA ----

    @Binds
    @IntoMap
    @ViewModelKey($ViewModelClassName$.class)
    abstract ViewModel bind$ViewModelClassName$($ViewModelClassName$ $ViewModelVariable$);

    ---- KOTLIN ----

    @Binds
    @IntoMap
    @ViewModelKey($ViewModelClassName$.class)
    abstract bind$ViewModelClassName$($ViewModelClassName$ : $ViewModelClassName$):ViewModel;


    ---- Edit Template Variables ----

    ViewModelClassName variableOfType(ViewModel)
    ViewModelVariable camelCase(ViewModelClassName)