From 1ac908f8899c9e4a54b248c897b3e8996a74c83f Mon Sep 17 00:00:00 2001 From: Ellison Chan Date: Wed, 15 Nov 2023 13:25:11 +0800 Subject: [PATCH] Upgrade compose lib to release version --- .idea/.name | 1 + .idea/codeStyles/Project.xml | 123 ++++++++++++++++++ .idea/codeStyles/codeStyleConfig.xml | 5 + .idea/compiler.xml | 2 +- .idea/deploymentTargetDropDown.xml | 17 +-- .idea/gradle.xml | 3 +- .idea/inspectionProfiles/Project_Default.xml | 5 + .idea/kotlinc.xml | 6 + .idea/misc.xml | 3 +- app/build.gradle | 74 +++++++---- .../com/ellison/flappybird/view/GameScreen.kt | 2 + build.gradle | 6 +- gradle/wrapper/gradle-wrapper.properties | 5 +- 13 files changed, 201 insertions(+), 51 deletions(-) create mode 100644 .idea/.name create mode 100644 .idea/codeStyles/Project.xml create mode 100644 .idea/codeStyles/codeStyleConfig.xml create mode 100644 .idea/kotlinc.xml diff --git a/.idea/.name b/.idea/.name new file mode 100644 index 0000000..1ed74cd --- /dev/null +++ b/.idea/.name @@ -0,0 +1 @@ +ComposeBird \ No newline at end of file diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml new file mode 100644 index 0000000..7643783 --- /dev/null +++ b/.idea/codeStyles/Project.xml @@ -0,0 +1,123 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml new file mode 100644 index 0000000..79ee123 --- /dev/null +++ b/.idea/codeStyles/codeStyleConfig.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml index fb7f4a8..b589d56 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/.idea/deploymentTargetDropDown.xml b/.idea/deploymentTargetDropDown.xml index 377725a..0c0c338 100644 --- a/.idea/deploymentTargetDropDown.xml +++ b/.idea/deploymentTargetDropDown.xml @@ -1,17 +1,10 @@ - - - - - - - - - - - - + + + + + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml index 526b4c2..f01eec3 100644 --- a/.idea/gradle.xml +++ b/.idea/gradle.xml @@ -5,15 +5,14 @@ diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml index 2842237..d235beb 100644 --- a/.idea/inspectionProfiles/Project_Default.xml +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -2,18 +2,23 @@ diff --git a/.idea/kotlinc.xml b/.idea/kotlinc.xml new file mode 100644 index 0000000..f8467b4 --- /dev/null +++ b/.idea/kotlinc.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml index 2e7f394..ea4e1d0 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,4 +1,3 @@ - - + diff --git a/app/build.gradle b/app/build.gradle index 57f5e2b..3eb9b06 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -4,13 +4,12 @@ plugins { } android { - compileSdk 31 - buildToolsVersion "30.0.3" + compileSdk 34 defaultConfig { applicationId "com.ellison.flappybird" minSdk 23 - targetSdk 31 + targetSdk 34 versionCode 2 versionName "1.1" @@ -32,7 +31,6 @@ android { } kotlinOptions { jvmTarget = '1.8' - useIR = true } buildFeatures { compose true @@ -41,34 +39,54 @@ android { kotlinCompilerExtensionVersion compose_version kotlinCompilerVersion '1.4.32' } + namespace 'com.ellison.flappybird' } dependencies { - dependencies { - implementation 'com.google.android.material:material:1.3.0' + def composeBom = platform('androidx.compose:compose-bom:2023.09.01') + implementation composeBom - implementation 'androidx.compose.ui:ui:1.0.0-beta07' - // Tooling support (Previews, etc.) - implementation 'androidx.compose.ui:ui-tooling:1.0.0-beta07' - // Foundation (Border, Background, Box, Image, Scroll, shapes, animations, etc.) - implementation 'androidx.compose.foundation:foundation:1.0.0-beta07' - // Material Design - implementation 'androidx.compose.material:material:1.0.0-beta07' - // Material design icons - implementation 'androidx.compose.material:material-icons-core:1.0.0-beta07' - implementation 'androidx.compose.material:material-icons-extended:1.0.0-beta07' - // Integration with activities - implementation 'androidx.activity:activity-compose:1.3.0-alpha08' - // Integration with ViewModels - implementation 'androidx.lifecycle:lifecycle-viewmodel-compose:1.0.0-alpha05' - // Integration with observables - implementation 'androidx.compose.runtime:runtime-livedata:1.0.0-beta07' - implementation 'androidx.compose.runtime:runtime-rxjava2:1.0.0-beta07' + implementation 'com.google.android.material:material:1.3.0' - // UI Tests - androidTestImplementation 'androidx.compose.ui:ui-test-junit4:1.0.0-beta07' + implementation 'androidx.compose.ui:ui' + // Tooling support (Previews, etc.) + implementation 'androidx.compose.ui:ui-tooling' + // Foundation (Border, Background, Box, Image, Scroll, shapes, animations, etc.) + implementation 'androidx.compose.foundation:foundation' + // Material Design + implementation 'androidx.compose.material:material' + // Material design icons + implementation 'androidx.compose.material:material-icons-core' + implementation 'androidx.compose.material:material-icons-extended' + // Integration with activities + implementation 'androidx.activity:activity-compose:1.7.2' + // Integration with ViewModels + implementation 'androidx.lifecycle:lifecycle-viewmodel-compose:2.5.1' + // Integration with observables + implementation 'androidx.compose.runtime:runtime-livedata:1.5.4' + implementation 'androidx.compose.runtime:runtime-rxjava2:1.5.4' - // Optional - APIs for SplashScreen, including compatibility helpers on devices prior Android 12 - implementation "androidx.core:core-splashscreen:1.0.0-alpha01" - } +// implementation 'androidx.compose.ui:ui:1.0.0-beta07' +// // Tooling support (Previews, etc.) +// implementation 'androidx.compose.ui:ui-tooling:1.0.0-beta07' +// // Foundation (Border, Background, Box, Image, Scroll, shapes, animations, etc.) +// implementation 'androidx.compose.foundation:foundation:1.0.0-beta07' +// // Material Design +// implementation 'androidx.compose.material:material:1.0.0-beta07' +// // Material design icons +// implementation 'androidx.compose.material:material-icons-core:1.0.0-beta07' +// implementation 'androidx.compose.material:material-icons-extended:1.0.0-beta07' +// // Integration with activities +// implementation 'androidx.activity:activity-compose:1.3.0-alpha08' +// // Integration with ViewModels +// implementation 'androidx.lifecycle:lifecycle-viewmodel-compose:1.0.0-alpha05' +// // Integration with observables +// implementation 'androidx.compose.runtime:runtime-livedata:1.0.0-beta07' +// implementation 'androidx.compose.runtime:runtime-rxjava2:1.0.0-beta07' + + // UI Tests + androidTestImplementation 'androidx.compose.ui:ui-test-junit4:1.0.0-beta07' + + // Optional - APIs for SplashScreen, including compatibility helpers on devices prior Android 12 + implementation "androidx.core:core-splashscreen:1.0.0-alpha01" } \ No newline at end of file diff --git a/app/src/main/java/com/ellison/flappybird/view/GameScreen.kt b/app/src/main/java/com/ellison/flappybird/view/GameScreen.kt index f2213ab..dc88071 100644 --- a/app/src/main/java/com/ellison/flappybird/view/GameScreen.kt +++ b/app/src/main/java/com/ellison/flappybird/view/GameScreen.kt @@ -6,6 +6,7 @@ import androidx.compose.foundation.background import androidx.compose.foundation.layout.* import androidx.compose.runtime.* import androidx.compose.ui.Alignment +import androidx.compose.ui.ExperimentalComposeUiApi import androidx.compose.ui.Modifier import androidx.compose.ui.input.pointer.pointerInteropFilter import androidx.compose.ui.layout.onGloballyPositioned @@ -19,6 +20,7 @@ import com.ellison.flappybird.ui.theme.ForegroundEarthYellow import com.ellison.flappybird.util.LogUtil import com.ellison.flappybird.viewmodel.GameViewModel +@OptIn(ExperimentalComposeUiApi::class) @Composable fun GameScreen( clickable: Clickable = Clickable() diff --git a/build.gradle b/build.gradle index 08702e2..bda4b4d 100644 --- a/build.gradle +++ b/build.gradle @@ -1,15 +1,15 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { ext { - compose_version = '1.0.0-beta07' + compose_version = '1.5.3' } repositories { google() mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:7.0.0' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.32" + classpath 'com.android.tools.build:gradle:8.1.1' + classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.10' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 78f7ead..7467c13 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,5 @@ -#Fri Jul 09 21:58:18 CST 2021 distributionBase=GRADLE_USER_HOME -distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip distributionPath=wrapper/dists zipStorePath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME +zipStoreBase=GRADLE_USER_HOME \ No newline at end of file