Last active
January 7, 2020 01:15
-
-
Save m1noon/017de53669f6681e48daa0b738aef58b to your computer and use it in GitHub Desktop.
Navigation Componentの依存関係
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
... | |
// add plugin if you use safe args. | |
apply plugin: "androidx.navigation.safeargs.kotlin" | |
... | |
android { | |
... | |
// Enable Java8 if you use safe args | |
compileOptions { | |
sourceCompatibility JavaVersion.VERSION_1_8 | |
targetCompatibility JavaVersion.VERSION_1_8 | |
} | |
kotlinOptions { | |
jvmTarget = JavaVersion.VERSION_1_8.toString() | |
} | |
... | |
dependencies { | |
// add dependencies for navigation component (nav_version is defined in 'build.gradle' of project root) | |
implementation "androidx.navigation:navigation-fragment-ktx:$nav_version" | |
implementation "androidx.navigation:navigation-ui-ktx:$nav_version" | |
} | |
... | |
} |
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
buildscript { | |
... | |
// set latest version | |
ext.nav_version='2.1.0' | |
... | |
dependencies { | |
... | |
// add plugin dependency if you use safe args | |
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$nav_version" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See document for more detail.