Skip to content

Commit 3c74551

Browse files
authored
Update dependencies for codelabs branch (#94)
* Deduplicate lifecycle runtime compose * kotlin 2.0 and compose gradle plugin * update compose bom and navigation suite * Update various UI libs * update test & other versions * run spotlessApply
1 parent e741b2e commit 3c74551

File tree

6 files changed

+33
-48
lines changed

6 files changed

+33
-48
lines changed

Diff for: .gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@
2121
.externalNativeBuild
2222
.cxx
2323
local.properties
24+
.kotlin

Diff for: app/build.gradle.kts

+4-14
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,20 @@
1414
* limitations under the License.
1515
*/
1616

17-
@Suppress("DSL_SCOPE_VIOLATION") // TODO: Remove once KTIJ-19369 is fixed
1817
plugins {
1918
alias(libs.plugins.androidApplication)
2019
alias(libs.plugins.baselineprofile)
20+
alias(libs.plugins.compose)
2121
alias(libs.plugins.hilt)
2222
alias(libs.plugins.kotlinAndroid)
2323
alias(libs.plugins.ksp)
2424
}
2525

2626
kotlin {
2727
jvmToolchain(17)
28+
compilerOptions {
29+
freeCompilerArgs = listOf("-Xcontext-receivers")
30+
}
2831
}
2932

3033
android {
@@ -47,20 +50,9 @@ android {
4750
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
4851
}
4952
}
50-
compileOptions {
51-
sourceCompatibility = JavaVersion.VERSION_17
52-
targetCompatibility = JavaVersion.VERSION_17
53-
}
54-
kotlinOptions {
55-
jvmTarget = "17"
56-
freeCompilerArgs = listOf("-Xcontext-receivers")
57-
}
5853
buildFeatures {
5954
compose = true
6055
}
61-
composeOptions {
62-
kotlinCompilerExtensionVersion = libs.versions.composeCompiler.get()
63-
}
6456
packaging {
6557
resources {
6658
excludes += "/META-INF/{AL2.0,LGPL2.1}"
@@ -85,7 +77,6 @@ dependencies {
8577
val composeBom = platform(libs.compose.bom)
8678
implementation(composeBom)
8779
androidTestImplementation(composeBom)
88-
implementation(libs.compose.foundation)
8980
implementation(libs.compose.ui)
9081
implementation(libs.compose.ui.graphics)
9182
implementation(libs.compose.ui.text.google.fonts)
@@ -106,7 +97,6 @@ dependencies {
10697
implementation(libs.graphics.shapes)
10798

10899
implementation(libs.lifecycle.ktx)
109-
implementation(libs.lifecycle.compose)
110100
implementation(libs.lifecycle.runtime.compose)
111101

112102
ksp(libs.room.compiler)

Diff for: app/src/main/java/com/google/android/samples/socialite/MainActivity.kt

+4-5
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import android.os.Bundle
2222
import android.view.WindowInsetsController
2323
import androidx.activity.ComponentActivity
2424
import androidx.activity.compose.setContent
25-
import androidx.activity.enableEdgeToEdge
2625
import androidx.compose.foundation.isSystemInDarkTheme
2726
import androidx.core.content.pm.ShortcutManagerCompat
2827
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
@@ -36,7 +35,6 @@ class MainActivity : ComponentActivity() {
3635
installSplashScreen()
3736
super.onCreate(savedInstanceState)
3837
setContent {
39-
4038
// setSystemBarAppearance can be removed after calling enableEdgeToEdge()
4139
setSystemBarAppearance(isSystemInDarkTheme())
4240

@@ -55,16 +53,17 @@ class MainActivity : ComponentActivity() {
5553
return ShortcutParams(shortcutId, text)
5654
}
5755

58-
private fun setSystemBarAppearance(isSystemInDarkTheme : Boolean) {
56+
private fun setSystemBarAppearance(isSystemInDarkTheme: Boolean) {
5957
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
6058
if (isSystemInDarkTheme) {
6159
window?.insetsController?.setSystemBarsAppearance(
62-
0, WindowInsetsController.APPEARANCE_LIGHT_STATUS_BARS
60+
0,
61+
WindowInsetsController.APPEARANCE_LIGHT_STATUS_BARS,
6362
)
6463
} else {
6564
window?.insetsController?.setSystemBarsAppearance(
6665
WindowInsetsController.APPEARANCE_LIGHT_STATUS_BARS,
67-
WindowInsetsController.APPEARANCE_LIGHT_STATUS_BARS
66+
WindowInsetsController.APPEARANCE_LIGHT_STATUS_BARS,
6867
)
6968
}
7069
}

Diff for: app/src/main/java/com/google/android/samples/socialite/ui/Main.kt

-3
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,11 @@ import android.app.Activity
2020
import android.content.Intent
2121
import android.content.pm.ActivityInfo
2222
import android.os.Bundle
23-
import androidx.compose.animation.core.CubicBezierEasing
2423
import androidx.compose.animation.core.FastOutLinearInEasing
2524
import androidx.compose.animation.core.FastOutSlowInEasing
2625
import androidx.compose.animation.core.tween
2726
import androidx.compose.animation.fadeIn
2827
import androidx.compose.animation.fadeOut
29-
import androidx.compose.animation.scaleIn
30-
import androidx.compose.animation.scaleOut
3128
import androidx.compose.foundation.layout.fillMaxSize
3229
import androidx.compose.runtime.Composable
3330
import androidx.compose.ui.Modifier

Diff for: build.gradle.kts

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ plugins {
2121
alias(libs.plugins.androidApplication) apply false
2222
alias(libs.plugins.androidTest) apply false
2323
alias(libs.plugins.baselineprofile) apply false
24+
alias(libs.plugins.compose) apply false
2425
alias(libs.plugins.kotlinAndroid) apply false
2526
alias(libs.plugins.spotless) apply false
2627
alias(libs.plugins.hilt) apply false

Diff for: gradle/libs.versions.toml

+23-26
Original file line numberDiff line numberDiff line change
@@ -13,40 +13,38 @@
1313
# limitations under the License.
1414

1515
[versions]
16-
accompanist = "0.32.0"
17-
activity = "1.9.0"
16+
accompanist = "0.34.0"
17+
activity = "1.9.1"
1818
agp = "8.2.2"
19-
benchmarkMacroJunit4 = "1.2.4"
20-
baselineprofile = "1.2.4"
21-
camera = "1.3.3"
22-
coil = "2.4.0"
23-
compose_bom = "2024.05.00"
24-
composeCompiler = "1.5.4" # Used in app/build.gradle.kts
25-
compose-foundation = "1.6.0-beta03"
26-
concurrent = "1.1.0"
19+
benchmarkMacroJunit4 = "1.3.0"
20+
baselineprofile = "1.3.0"
21+
camera = "1.3.4"
22+
coil = "2.6.0"
23+
compose_bom = "2024.08.00"
24+
concurrent = "1.2.0"
2725
core = "1.13.1"
2826
core-splashscreen = "1.2.0-alpha01"
29-
espresso = "3.5.1"
30-
graphics = "1.0.0-beta01"
31-
hilt = "2.48.1"
32-
hiltNavigationCompose = "1.1.0"
27+
espresso = "3.6.1"
28+
graphics = "1.0.0"
29+
hilt = "2.51.1"
30+
hiltNavigationCompose = "1.2.0"
3331
junit = "4.13.2"
34-
kotlin = "1.9.20"
35-
ksp = "1.9.20-1.0.14"
36-
lifecycle = "2.7.0"
32+
kotlin = "2.0.0"
33+
ksp = "2.0.0-1.0.21"
34+
lifecycle = "2.8.4"
3735
material3 = "1.2.1"
38-
media3 = "1.3.1"
36+
media3 = "1.4.1"
3937
navigation = "2.7.7"
4038
profileinstaller = "1.3.1"
4139
room = "2.6.1"
4240
spotless = "6.24.0"
43-
test = "1.1.5"
44-
truth = "1.1.3"
41+
test = "1.2.1"
42+
truth = "1.4.4"
4543
turbine = "1.0.0"
4644
uiautomator = "2.3.0"
47-
window = "1.2.0"
48-
material3-adaptive-navigation-suite = "1.0.0-alpha05"
49-
glance = "1.1.0-beta02"
45+
window = "1.3.0"
46+
material3-adaptive-navigation-suite = "1.3.0-rc01"
47+
glance = "1.1.0"
5048

5149
[libraries]
5250
accompanist-painter = { group = "com.google.accompanist", name = "accompanist-drawablepainter", version.ref = "accompanist" }
@@ -65,7 +63,6 @@ compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref =
6563
compose-material-icons = { group = "androidx.compose.material", name = "material-icons-extended" }
6664
compose-material3 = { group = "androidx.compose.material3", name = "material3", version.ref = "material3" }
6765
compose-material3-adaptive = { group = "androidx.compose.material3", name = "material3-adaptive-navigation-suite", version.ref = "material3-adaptive-navigation-suite"}
68-
compose-foundation = { group = "androidx.compose.foundation", name = "foundation" }
6966
compose-ui = { group = "androidx.compose.ui", name = "ui" }
7067
compose-ui-graphics = { group = "androidx.compose.ui", name = "ui-graphics" }
7168
compose-ui-test = { group = "androidx.compose.ui", name = "ui-test-junit4" }
@@ -84,9 +81,8 @@ hilt-android = { group = "com.google.dagger", name = "hilt-android", version.ref
8481
hilt-compiler = { group = "com.google.dagger", name = "hilt-android-compiler", version.ref = "hilt" }
8582
hilt-navigation-compose = { group = "androidx.hilt", name = "hilt-navigation-compose", version.ref = "hiltNavigationCompose" }
8683
junit = { group = "junit", name = "junit", version.ref = "junit" }
87-
lifecycle-compose = { group = "androidx.lifecycle", name = "lifecycle-runtime-compose", version.ref = "lifecycle" }
8884
lifecycle-ktx = { group = "androidx.lifecycle", name = "lifecycle-runtime-ktx", version.ref = "lifecycle" }
89-
lifecycle-runtime-compose = { module = "androidx.lifecycle:lifecycle-runtime-compose", version.ref = "lifecycle" }
85+
lifecycle-runtime-compose = { group = "androidx.lifecycle", name = "lifecycle-runtime-compose", version.ref = "lifecycle" }
9086
media3-common = { group = "androidx.media3", name = "media3-common", version.ref = "media3" }
9187
media3-effect = { group = "androidx.media3", name = "media3-effect", version.ref = "media3" }
9288
media3-exoplayer = { group = "androidx.media3", name = "media3-exoplayer", version.ref = "media3" }
@@ -108,6 +104,7 @@ ktlint = "com.pinterest.ktlint:ktlint-cli:1.1.1" # Used in build.gradle.kts
108104
androidApplication = { id = "com.android.application", version.ref = "agp" }
109105
androidTest = { id = "com.android.test", version.ref = "agp" }
110106
baselineprofile = { id = "androidx.baselineprofile", version.ref = "baselineprofile" }
107+
compose = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
111108
hilt = { id = "com.google.dagger.hilt.android", version.ref = "hilt" }
112109
kotlinAndroid = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
113110
ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" }

0 commit comments

Comments
 (0)