diff --git a/README.md b/README.md index 0331244..cfb2257 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ The app uses the following multiplatform dependencies in its implementation: - [Compose Navigation](https://www.jetbrains.com/help/kotlin-multiplatform-dev/compose-navigation-routing.html) - [Ktor](https://ktor.io/) for networking - [kotlinx.serialization](https://github.com/Kotlin/kotlinx.serialization) for JSON handling -- [Kamel](https://github.com/Kamel-Media/Kamel) for image loading +- [Coil](https://github.com/coil-kt/coil) for image loading - [Koin](https://github.com/InsertKoinIO/koin) for dependency injection > These are just some of the possible libraries to use for these tasks with Kotlin Multiplatform, and their usage here isn't a strong recommendation for these specific libraries over the available alternatives. You can find a wide variety of curated multiplatform libraries in the [kmp-awesome](https://github.com/terrakok/kmp-awesome) repository. diff --git a/composeApp/build.gradle.kts b/composeApp/build.gradle.kts index a1fd855..fd41ef4 100644 --- a/composeApp/build.gradle.kts +++ b/composeApp/build.gradle.kts @@ -49,7 +49,8 @@ kotlin { implementation(libs.ktor.client.content.negotiation) implementation(libs.ktor.serialization.kotlinx.json) - implementation(libs.kamel) + implementation(libs.coil.compose) + implementation(libs.coil.network.ktor) implementation(libs.koin.core) implementation(libs.koin.compose.viewmodel) implementation(libs.navigation.compose) diff --git a/composeApp/src/commonMain/kotlin/com/jetbrains/kmpapp/screens/detail/DetailScreen.kt b/composeApp/src/commonMain/kotlin/com/jetbrains/kmpapp/screens/detail/DetailScreen.kt index 0fb88a7..35fafc7 100644 --- a/composeApp/src/commonMain/kotlin/com/jetbrains/kmpapp/screens/detail/DetailScreen.kt +++ b/composeApp/src/commonMain/kotlin/com/jetbrains/kmpapp/screens/detail/DetailScreen.kt @@ -33,10 +33,9 @@ import androidx.compose.ui.text.buildAnnotatedString import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.withStyle import androidx.compose.ui.unit.dp +import coil3.compose.AsyncImage import com.jetbrains.kmpapp.data.MuseumObject import com.jetbrains.kmpapp.screens.EmptyScreenContent -import io.kamel.image.KamelImage -import io.kamel.image.asyncPainterResource import kmp_app_template.composeapp.generated.resources.Res import kmp_app_template.composeapp.generated.resources.back import kmp_app_template.composeapp.generated.resources.label_artist @@ -88,8 +87,8 @@ private fun ObjectDetails( .verticalScroll(rememberScrollState()) .padding(paddingValues) ) { - KamelImage( - resource = asyncPainterResource(data = obj.primaryImageSmall), + AsyncImage( + model = obj.primaryImageSmall, contentDescription = obj.title, contentScale = ContentScale.FillWidth, modifier = Modifier diff --git a/composeApp/src/commonMain/kotlin/com/jetbrains/kmpapp/screens/list/ListScreen.kt b/composeApp/src/commonMain/kotlin/com/jetbrains/kmpapp/screens/list/ListScreen.kt index 4ed0d4f..1b9d633 100644 --- a/composeApp/src/commonMain/kotlin/com/jetbrains/kmpapp/screens/list/ListScreen.kt +++ b/composeApp/src/commonMain/kotlin/com/jetbrains/kmpapp/screens/list/ListScreen.kt @@ -28,10 +28,9 @@ import androidx.compose.ui.graphics.Color import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.dp +import coil3.compose.AsyncImage import com.jetbrains.kmpapp.data.MuseumObject import com.jetbrains.kmpapp.screens.EmptyScreenContent -import io.kamel.image.KamelImage -import io.kamel.image.asyncPainterResource import org.koin.compose.viewmodel.koinViewModel @Composable @@ -88,8 +87,8 @@ private fun ObjectFrame( .padding(8.dp) .clickable { onClick() } ) { - KamelImage( - resource = asyncPainterResource(data = obj.primaryImageSmall), + AsyncImage( + model = obj.primaryImageSmall, contentDescription = obj.title, contentScale = ContentScale.Crop, modifier = Modifier diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 0344b46..015bfaf 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,19 +1,20 @@ [versions] -agp = "8.6.0" -androidx-activityCompose = "1.9.2" -androidx-ui-tooling = "1.7.2" -compose-multiplatform = "1.6.11" -kamel = "0.9.5" +agp = "8.6.1" +androidx-activityCompose = "1.9.3" +androidx-ui-tooling = "1.7.4" +coil = "3.0.0-rc02" +compose-multiplatform = "1.7.0" koin = "4.0.0" -kotlin = "2.0.20" -ktor = "2.3.12" +kotlin = "2.0.21" +ktor = "3.0.0" navigationCompose = "2.8.0-alpha10" [libraries] androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "androidx-activityCompose" } androidx-compose-ui-tooling = { module = "androidx.compose.ui:ui-tooling", version.ref = "androidx-ui-tooling" } androidx-compose-ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview", version.ref = "androidx-ui-tooling" } -kamel = { module = "media.kamel:kamel-image", version.ref = "kamel" } +coil-compose = { group = "io.coil-kt.coil3", name = "coil-compose", version.ref = "coil" } +coil-network-ktor = { group = "io.coil-kt.coil3", name = "coil-network-ktor3", version.ref = "coil" } koin-core = { module = "io.insert-koin:koin-core", version.ref = "koin" } koin-compose-viewmodel = { module = "io.insert-koin:koin-compose-viewmodel", version.ref = "koin" } ktor-client-content-negotiation = { module = "io.ktor:ktor-client-content-negotiation", version.ref = "ktor" }