Skip to content

Commit

Permalink
Merge pull request #213 from joreilly/update_dependencies
Browse files Browse the repository at this point in the history
update dependencies
  • Loading branch information
joreilly authored Jul 29, 2024
2 parents 613fa32 + c82793b commit 7dab236
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 31 deletions.
1 change: 0 additions & 1 deletion androidApp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ dependencies {
implementation(libs.androidx.compose.ui)
implementation(libs.androidx.compose.ui.tooling)
implementation(libs.androidx.navigation.compose)
implementation(libs.androidx.glance)

testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test:runner:1.5.2")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ import androidx.compose.runtime.*
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import bikeshare.common.generated.resources.Res
import bikeshare.common.generated.resources.allDrawableResources
import dev.johnoreilly.common.screens.CountryListScreen
import dev.johnoreilly.common.viewmodel.Country
import org.jetbrains.compose.resources.DrawableResource
import org.jetbrains.compose.resources.InternalResourceApi
import org.jetbrains.compose.resources.ExperimentalResourceApi
import org.jetbrains.compose.resources.painterResource


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


@OptIn(ExperimentalResourceApi::class)
@Composable
fun CountryView(country: Country, countrySelected: (country: Country) -> Unit) {
Row(
Expand All @@ -46,24 +48,16 @@ fun CountryView(country: Country, countrySelected: (country: Country) -> Unit) {
.padding(start = 16.dp, top = 8.dp, end = 16.dp, bottom = 8.dp),
verticalAlignment = Alignment.CenterVertically
) {
val flagDrawable = getDrawable("flag_${country.code.lowercase()}")
Image(
painterResource(flagDrawable),
modifier = Modifier.size(32.dp),
contentDescription = country.displayName
)
val flagDrawable = Res.allDrawableResources["flag_${country.code.lowercase()}"]
if (flagDrawable != null) {
Image(
painterResource(flagDrawable),
modifier = Modifier.size(32.dp),
contentDescription = country.displayName
)
}

Spacer(modifier = Modifier.size(16.dp))
Text(text = country.displayName, style = MaterialTheme.typography.bodyLarge)
}
}

@OptIn(InternalResourceApi::class)
private fun getDrawable(id: String): DrawableResource =
DrawableResource(
"drawable:$id",
setOf(
org.jetbrains.compose.resources.ResourceItem(setOf(),
"composeResources/bikeshare.common.generated.resources/drawable/$id.xml", -1, -1),
)
)
}
16 changes: 7 additions & 9 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[versions]
kotlin = "2.0.0"
ksp = "2.0.0-1.0.22"
ksp = "2.0.0-1.0.23"

coroutines = "1.8.1"
kotlinxSerialization = "1.6.3"
coroutines = "1.9.0-RC"
kotlinxSerialization = "1.7.1"
kotlinxDateTime = "0.6.0"

androidGradlePlugin = "8.5.0"
androidGradlePlugin = "8.5.1"
circuit = "0.22.2"
kotlininject = "0.7.1"
ktor = "3.0.0-beta-2"
Expand All @@ -15,12 +15,11 @@ realm = "2.0.0"
kmpNativeCoroutines = "1.0.0-ALPHA-31"
kmpObservableViewModel = "1.0.0-BETA-3"

compose-multiplatform = "1.6.11"
androidxActivity = "1.9.0"
compose-multiplatform = "1.7.0-alpha02"
androidxActivity = "1.9.1"
androidxComposeBom = "2024.06.00"
androidxNavigationCompose = "2.7.7"
androidxLifecycle = "2.8.2"
glance = "1.0.0"
androidxLifecycle = "2.8.4"
junit = "4.13.2"

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

circuit-foundation = { module = "com.slack.circuit:circuit-foundation", version.ref = "circuit" }
kotlininject-compiler = { module = "me.tatarka.inject:kotlin-inject-compiler-ksp", version.ref = "kotlininject" }
Expand Down
4 changes: 2 additions & 2 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ pluginManagement {
}
mavenCentral()
gradlePluginPortal()
maven("https://oss.sonatype.org/content/repositories/snapshots")
//maven("https://oss.sonatype.org/content/repositories/snapshots")
}
}
dependencyResolutionManagement {
repositories {
google()
mavenCentral()
maven("https://oss.sonatype.org/content/repositories/snapshots")
//maven("https://oss.sonatype.org/content/repositories/snapshots")
}
}

Expand Down

0 comments on commit 7dab236

Please sign in to comment.