diff --git a/README.md b/README.md index 437dc50..daa3569 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ The app uses the following multiplatform dependencies in its implementation: - [Compose Multiplatform](https://jb.gg/compose) for UI - [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 - [moko-resources](https://github.com/icerockdev/moko-resources) for string resources - [Koin](https://github.com/InsertKoinIO/koin) for dependency injection - [Voyager](https://github.com/adrielcafe/voyager) for navigation and screen models diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 8fe9eed..f90b722 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -3,7 +3,7 @@ androidx-activityCompose = "1.9.2" androidx-ui-tooling = "1.7.0" androidx-lifecycle = "2.8.4" coroutines = "1.8.1" -kamel = "0.9.5" +coil = "3.0.0" koin = "3.5.6" ktor = "2.3.12" voyager = "1.0.0" @@ -12,7 +12,8 @@ voyager = "1.0.0" androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "androidx-activityCompose" } androidx-compose-ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview", version.ref = "androidx-ui-tooling" } androidx-lifecycle-runtime-compose = { module = "org.jetbrains.androidx.lifecycle:lifecycle-runtime-compose", version.ref = "androidx-lifecycle" } -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" } kotlinx-coroutines-swing = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-swing", version.ref = "coroutines" } koin-core = { module = "io.insert-koin:koin-core", version.ref = "koin" } ktor-client-content-negotiation = { module = "io.ktor:ktor-client-content-negotiation", version.ref = "ktor" } diff --git a/shared/module.yaml b/shared/module.yaml index 5684271..67a068d 100644 --- a/shared/module.yaml +++ b/shared/module.yaml @@ -10,7 +10,8 @@ dependencies: - $libs.ktor.client.core - $libs.ktor.client.content.negotiation - $libs.ktor.serialization.kotlinx.json - - $libs.kamel + - $libs.coil.compose + - $libs.coil.network.ktor - $libs.koin.core - $libs.voyager.navigator - $libs.voyager.koin diff --git a/shared/src/screens/detail/DetailScreen.kt b/shared/src/screens/detail/DetailScreen.kt index fd6c535..3b020ba 100644 --- a/shared/src/screens/detail/DetailScreen.kt +++ b/shared/src/screens/detail/DetailScreen.kt @@ -38,10 +38,9 @@ import cafe.adriel.voyager.core.screen.Screen import cafe.adriel.voyager.koin.getScreenModel import cafe.adriel.voyager.navigator.LocalNavigator import cafe.adriel.voyager.navigator.currentOrThrow +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 data class DetailScreen(val objectId: Int) : Screen { @Composable @@ -85,8 +84,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/shared/src/screens/list/ListScreen.kt b/shared/src/screens/list/ListScreen.kt index 980b95a..d097113 100644 --- a/shared/src/screens/list/ListScreen.kt +++ b/shared/src/screens/list/ListScreen.kt @@ -31,11 +31,10 @@ import cafe.adriel.voyager.core.screen.Screen import cafe.adriel.voyager.koin.getScreenModel import cafe.adriel.voyager.navigator.LocalNavigator import cafe.adriel.voyager.navigator.currentOrThrow +import coil3.compose.AsyncImage import com.jetbrains.kmpapp.data.MuseumObject import com.jetbrains.kmpapp.screens.EmptyScreenContent import com.jetbrains.kmpapp.screens.detail.DetailScreen -import io.kamel.image.KamelImage -import io.kamel.image.asyncPainterResource data object ListScreen : Screen { @Composable @@ -94,8 +93,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