chore: 引入 Jetpack Compose

This commit is contained in:
HuanCheng65 2022-08-01 15:27:38 +08:00
parent 59f052e844
commit 3ccd3d41e6
No known key found for this signature in database
GPG Key ID: E9031EF91A805148
1 changed files with 20 additions and 0 deletions

View File

@ -36,6 +36,12 @@ android {
useSupportLibrary true useSupportLibrary true
} }
} }
buildFeatures {
compose true
}
composeOptions {
kotlinCompilerExtensionVersion '1.2.0'
}
signingConfigs { signingConfigs {
release { release {
keyAlias keystoreProperties["releaseKeyAlias"] keyAlias keystoreProperties["releaseKeyAlias"]
@ -65,6 +71,7 @@ android {
} }
kotlinOptions { kotlinOptions {
jvmTarget = '1.8' jvmTarget = '1.8'
freeCompilerArgs += ["-P", "plugin:androidx.compose.compiler.plugins.kotlin:suppressKotlinVersionCompatibilityCheck=true"]
} }
packagingOptions { packagingOptions {
resources { resources {
@ -81,6 +88,19 @@ android {
} }
dependencies { dependencies {
def compose_version = '1.1.1'
// Integration with activities
implementation 'androidx.activity:activity-compose:1.5.0'
// Compose Material Design
implementation "androidx.compose.material:material:$compose_version"
// Animations
implementation "androidx.compose.animation:animation:$compose_version"
// Tooling support (Previews, etc.)
implementation "androidx.compose.ui:ui-tooling:$compose_version"
// When using a MDC theme
implementation "com.google.android.material:compose-theme-adapter:1.1.1"
implementation 'com.google.protobuf:protobuf-java:3.21.1' implementation 'com.google.protobuf:protobuf-java:3.21.1'
implementation 'com.github.gzu-liyujiang:Android_CN_OAID:4.2.4' implementation 'com.github.gzu-liyujiang:Android_CN_OAID:4.2.4'