Skip to content

Commit 54e512a

Browse files
committed
Update buildscripts with dependencies, align with tutorial.
1 parent 5069efd commit 54e512a

File tree

4 files changed

+27
-29
lines changed

4 files changed

+27
-29
lines changed

step4/androidApp/build.gradle.kts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ android {
4040

4141
dependencies {
4242
implementation(project(":shared"))
43-
implementation("androidx.compose.ui:ui:1.5.3")
44-
implementation("androidx.compose.ui:ui-tooling:1.5.3")
45-
implementation("androidx.compose.ui:ui-tooling-preview:1.5.3")
46-
implementation("androidx.compose.foundation:foundation:1.5.3")
47-
implementation("androidx.compose.material:material:1.5.3")
48-
implementation("androidx.activity:activity-compose:1.8.0")
49-
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.1")
50-
implementation("androidx.lifecycle:lifecycle-runtime-compose:2.6.1")
43+
implementation("androidx.compose.ui:ui:1.5.4")
44+
implementation("androidx.compose.ui:ui-tooling:1.5.4")
45+
implementation("androidx.compose.ui:ui-tooling-preview:1.5.4")
46+
implementation("androidx.compose.foundation:foundation:1.5.4")
47+
implementation("androidx.compose.material3:material3:1.1.2")
48+
implementation("androidx.activity:activity-compose:1.8.1")
49+
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.2")
50+
implementation("androidx.lifecycle:lifecycle-runtime-compose:2.6.2")
5151
}

step4/androidApp/src/main/java/com/jetbrains/simplelogin/kotlinmultiplatformsandbox/MainActivity.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ import androidx.compose.foundation.layout.PaddingValues
99
import androidx.compose.foundation.layout.fillMaxSize
1010
import androidx.compose.foundation.lazy.LazyColumn
1111
import androidx.compose.foundation.lazy.items
12-
import androidx.compose.material.Divider
13-
import androidx.compose.material.MaterialTheme
14-
import androidx.compose.material.Surface
15-
import androidx.compose.material.Text
12+
import androidx.compose.material3.Divider
13+
import androidx.compose.material3.MaterialTheme
14+
import androidx.compose.material3.Surface
15+
import androidx.compose.material3.Text
1616
import androidx.compose.runtime.Composable
1717
import androidx.compose.ui.Modifier
1818
import androidx.compose.ui.tooling.preview.Preview
@@ -28,7 +28,7 @@ class MainActivity : ComponentActivity() {
2828
MyApplicationTheme {
2929
Surface(
3030
modifier = Modifier.fillMaxSize(),
31-
color = MaterialTheme.colors.background
31+
color = MaterialTheme.colorScheme.background
3232
) {
3333
val greetings = mainViewModel.greetingList.collectAsStateWithLifecycle()
3434
GreetingView(phrases = greetings.value)

step4/androidApp/src/main/java/com/jetbrains/simplelogin/kotlinmultiplatformsandbox/MyApplicationTheme.kt

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ package com.jetbrains.simplelogin.kotlinmultiplatformsandbox
22

33
import androidx.compose.foundation.isSystemInDarkTheme
44
import androidx.compose.foundation.shape.RoundedCornerShape
5-
import androidx.compose.material.MaterialTheme
6-
import androidx.compose.material.Shapes
7-
import androidx.compose.material.Typography
8-
import androidx.compose.material.darkColors
9-
import androidx.compose.material.lightColors
5+
import androidx.compose.material3.MaterialTheme
6+
import androidx.compose.material3.Shapes
7+
import androidx.compose.material3.Typography
8+
import androidx.compose.material3.darkColorScheme
9+
import androidx.compose.material3.lightColorScheme
1010
import androidx.compose.runtime.Composable
1111
import androidx.compose.ui.graphics.Color
1212
import androidx.compose.ui.text.TextStyle
@@ -21,20 +21,18 @@ fun MyApplicationTheme(
2121
content: @Composable () -> Unit
2222
) {
2323
val colors = if (darkTheme) {
24-
darkColors(
24+
darkColorScheme(
2525
primary = Color(0xFFBB86FC),
26-
primaryVariant = Color(0xFF3700B3),
2726
secondary = Color(0xFF03DAC5)
2827
)
2928
} else {
30-
lightColors(
29+
lightColorScheme(
3130
primary = Color(0xFF6200EE),
32-
primaryVariant = Color(0xFF3700B3),
3331
secondary = Color(0xFF03DAC5)
3432
)
3533
}
3634
val typography = Typography(
37-
body1 = TextStyle(
35+
bodyLarge = TextStyle(
3836
fontFamily = FontFamily.Default,
3937
fontWeight = FontWeight.Normal,
4038
fontSize = 16.sp
@@ -47,7 +45,7 @@ fun MyApplicationTheme(
4745
)
4846

4947
MaterialTheme(
50-
colors = colors,
48+
colorScheme = colors,
5149
typography = typography,
5250
shapes = shapes,
5351
content = content

step4/build.gradle.kts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
plugins {
22
//trick: for the same plugin versions in all sub-modules
3-
id("com.android.application").version("8.1.2").apply(false)
4-
id("com.android.library").version("8.1.2").apply(false)
3+
id("com.android.application").version("8.1.4").apply(false)
4+
id("com.android.library").version("8.1.4").apply(false)
55
kotlin("android").version("1.9.20-Beta2").apply(false)
66
kotlin("multiplatform").version("1.9.20-Beta2").apply(false)
7-
kotlin("plugin.serialization").version("1.8.22").apply(false)
8-
id("com.google.devtools.ksp").version("1.8.22-1.0.11").apply(false)
9-
id("com.rickclephas.kmp.nativecoroutines").version("1.0.0-ALPHA-12").apply(false)
7+
kotlin("plugin.serialization").version("1.9.20-Beta2").apply(false)
8+
id("com.google.devtools.ksp").version("1.9.10-1.0.13").apply(false)
9+
id("com.rickclephas.kmp.nativecoroutines").version("1.0.0-ALPHA-18").apply(false)
1010
}
1111

1212
tasks.register("clean", Delete::class) {

0 commit comments

Comments
 (0)