Skip to content

Instantly share code, notes, and snippets.

@adam-hurwitz
Last active July 7, 2020 20:57
Show Gist options
  • Save adam-hurwitz/0ba551d456c2029d41677554270099bd to your computer and use it in GitHub Desktop.
Save adam-hurwitz/0ba551d456c2029d41677554270099bd to your computer and use it in GitHub Desktop.
Optimizing ViewModel with Lifecycle 2.2.0: Setup
android {
...
kotlinOptions { jvmTarget = '1.8' }
}
dependencies {
...
// ViewModel
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:X.X.X"
// LiveData
implementation "androidx.lifecycle:lifecycle-livedata-ktx:X.X.X"
// Navigation
implementation "androidx.navigation:navigation-ui-ktx:X.X.X"
implementation "androidx.navigation:navigation-fragment-ktx:X.X.X"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment