Skip to content

Commit 7dab236

Browse files
authored
Merge pull request #213 from joreilly/update_dependencies
update dependencies
2 parents 613fa32 + c82793b commit 7dab236

File tree

4 files changed

+22
-31
lines changed

4 files changed

+22
-31
lines changed

androidApp/build.gradle.kts

-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ dependencies {
112112
implementation(libs.androidx.compose.ui)
113113
implementation(libs.androidx.compose.ui.tooling)
114114
implementation(libs.androidx.navigation.compose)
115-
implementation(libs.androidx.glance)
116115

117116
testImplementation("junit:junit:4.13.2")
118117
androidTestImplementation("androidx.test:runner:1.5.2")

common/src/commonMain/kotlin/dev/johnoreilly/common/ui/CountryListUI.kt

+13-19
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,11 @@ import androidx.compose.runtime.*
1616
import androidx.compose.ui.Alignment
1717
import androidx.compose.ui.Modifier
1818
import androidx.compose.ui.unit.dp
19+
import bikeshare.common.generated.resources.Res
20+
import bikeshare.common.generated.resources.allDrawableResources
1921
import dev.johnoreilly.common.screens.CountryListScreen
2022
import dev.johnoreilly.common.viewmodel.Country
21-
import org.jetbrains.compose.resources.DrawableResource
22-
import org.jetbrains.compose.resources.InternalResourceApi
23+
import org.jetbrains.compose.resources.ExperimentalResourceApi
2324
import org.jetbrains.compose.resources.painterResource
2425

2526

@@ -37,6 +38,7 @@ fun CountryListUi(state: CountryListScreen.State, modifier: Modifier = Modifier)
3738
}
3839

3940

41+
@OptIn(ExperimentalResourceApi::class)
4042
@Composable
4143
fun CountryView(country: Country, countrySelected: (country: Country) -> Unit) {
4244
Row(
@@ -46,24 +48,16 @@ fun CountryView(country: Country, countrySelected: (country: Country) -> Unit) {
4648
.padding(start = 16.dp, top = 8.dp, end = 16.dp, bottom = 8.dp),
4749
verticalAlignment = Alignment.CenterVertically
4850
) {
49-
val flagDrawable = getDrawable("flag_${country.code.lowercase()}")
50-
Image(
51-
painterResource(flagDrawable),
52-
modifier = Modifier.size(32.dp),
53-
contentDescription = country.displayName
54-
)
51+
val flagDrawable = Res.allDrawableResources["flag_${country.code.lowercase()}"]
52+
if (flagDrawable != null) {
53+
Image(
54+
painterResource(flagDrawable),
55+
modifier = Modifier.size(32.dp),
56+
contentDescription = country.displayName
57+
)
58+
}
5559

5660
Spacer(modifier = Modifier.size(16.dp))
5761
Text(text = country.displayName, style = MaterialTheme.typography.bodyLarge)
5862
}
59-
}
60-
61-
@OptIn(InternalResourceApi::class)
62-
private fun getDrawable(id: String): DrawableResource =
63-
DrawableResource(
64-
"drawable:$id",
65-
setOf(
66-
org.jetbrains.compose.resources.ResourceItem(setOf(),
67-
"composeResources/bikeshare.common.generated.resources/drawable/$id.xml", -1, -1),
68-
)
69-
)
63+
}

gradle/libs.versions.toml

+7-9
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
[versions]
22
kotlin = "2.0.0"
3-
ksp = "2.0.0-1.0.22"
3+
ksp = "2.0.0-1.0.23"
44

5-
coroutines = "1.8.1"
6-
kotlinxSerialization = "1.6.3"
5+
coroutines = "1.9.0-RC"
6+
kotlinxSerialization = "1.7.1"
77
kotlinxDateTime = "0.6.0"
88

9-
androidGradlePlugin = "8.5.0"
9+
androidGradlePlugin = "8.5.1"
1010
circuit = "0.22.2"
1111
kotlininject = "0.7.1"
1212
ktor = "3.0.0-beta-2"
@@ -15,12 +15,11 @@ realm = "2.0.0"
1515
kmpNativeCoroutines = "1.0.0-ALPHA-31"
1616
kmpObservableViewModel = "1.0.0-BETA-3"
1717

18-
compose-multiplatform = "1.6.11"
19-
androidxActivity = "1.9.0"
18+
compose-multiplatform = "1.7.0-alpha02"
19+
androidxActivity = "1.9.1"
2020
androidxComposeBom = "2024.06.00"
2121
androidxNavigationCompose = "2.7.7"
22-
androidxLifecycle = "2.8.2"
23-
glance = "1.0.0"
22+
androidxLifecycle = "2.8.4"
2423
junit = "4.13.2"
2524

2625
minSdk = "24"
@@ -49,7 +48,6 @@ androidx-compose-material3 = { group = "androidx.compose.material3", name = "ma
4948
androidx-compose-material3-WindowSizeClass = { group = "androidx.compose.material3", name="material3-window-size-class" }
5049
androidx-navigation-compose = { module = "androidx.navigation:navigation-compose", version.ref = "androidxNavigationCompose" }
5150
androidx-lifecycle-compose = { module = "androidx.lifecycle:lifecycle-runtime-compose", version.ref = "androidxLifecycle" }
52-
androidx-glance = { module = "androidx.glance:glance-appwidget", version.ref = "glance" }
5351

5452
circuit-foundation = { module = "com.slack.circuit:circuit-foundation", version.ref = "circuit" }
5553
kotlininject-compiler = { module = "me.tatarka.inject:kotlin-inject-compiler-ksp", version.ref = "kotlininject" }

settings.gradle.kts

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ pluginManagement {
1313
}
1414
mavenCentral()
1515
gradlePluginPortal()
16-
maven("https://oss.sonatype.org/content/repositories/snapshots")
16+
//maven("https://oss.sonatype.org/content/repositories/snapshots")
1717
}
1818
}
1919
dependencyResolutionManagement {
2020
repositories {
2121
google()
2222
mavenCentral()
23-
maven("https://oss.sonatype.org/content/repositories/snapshots")
23+
//maven("https://oss.sonatype.org/content/repositories/snapshots")
2424
}
2525
}
2626

0 commit comments

Comments
 (0)