Skip to content

Instantly share code, notes, and snippets.

@widiarifki
Last active August 31, 2021 09:37
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 widiarifki/7176c4a600ca6e2b108bf88703e6be69 to your computer and use it in GitHub Desktop.
Save widiarifki/7176c4a600ca6e2b108bf88703e6be69 to your computer and use it in GitHub Desktop.
android {
// your other configuration..
buildFeatures {
// enable jetpack compose in the module
compose true
}
// target Java compiler to Java 8
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
// target Kotlin compiler to Java 8
kotlinOptions {
jvmTarget = '1.8'
}
// compose compiler
composeOptions {
kotlinCompilerExtensionVersion compose_version
}
}
dependencies {
// your other dependencies
// Compose
// integration with activity
implementation 'androidx.activity:activity-compose:1.3.1'
// foundation (Column, Row, etc)
implementation "androidx.compose.foundation:foundation:$compose_version"
// UI component & function
implementation "androidx.compose.ui:ui:$compose_version"
// Material theme design
implementation "androidx.compose.material:material:$compose_version"
// Integration with livedata, etc
implementation "androidx.compose.runtime:runtime-livedata:$compose_version"
// Tooling preview
debugImplementation "androidx.compose.ui:ui-tooling-preview:$compose_version"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment