diff --git a/build-logic/convention/src/main/kotlin/com/stslex/wizard/convention/KmpCompose.kt b/build-logic/convention/src/main/kotlin/com/stslex/wizard/convention/KmpCompose.kt index 35d6982..6ac62b5 100644 --- a/build-logic/convention/src/main/kotlin/com/stslex/wizard/convention/KmpCompose.kt +++ b/build-logic/convention/src/main/kotlin/com/stslex/wizard/convention/KmpCompose.kt @@ -22,7 +22,6 @@ fun Project.configureKMPCompose( implementation(libs.findLibrary("kotlinx-collections-immutable").get()) implementation(libs.findLibrary("koin-compose").get()) implementation(libs.findLibrary("lifecycle-viewmodel").get()) - implementation(libs.findLibrary("kamel").get()) } } } \ No newline at end of file diff --git a/commonApp/proguard-rules.pro b/commonApp/proguard-rules.pro index ff59496..cdc164c 100644 --- a/commonApp/proguard-rules.pro +++ b/commonApp/proguard-rules.pro @@ -18,4 +18,6 @@ # If you keep the line number information, uncomment this to # hide the original source file name. -#-renamesourcefileattribute SourceFile \ No newline at end of file +#-renamesourcefileattribute SourceFile + +-keep class io.ktor.** { *; } \ No newline at end of file diff --git a/commonApp/src/commonMain/kotlin/com/stslex/wizard/InitialApp.kt b/commonApp/src/commonMain/kotlin/com/stslex/wizard/InitialApp.kt index 606d564..7e6ac0e 100644 --- a/commonApp/src/commonMain/kotlin/com/stslex/wizard/InitialApp.kt +++ b/commonApp/src/commonMain/kotlin/com/stslex/wizard/InitialApp.kt @@ -51,7 +51,8 @@ fun InitialApp( val authScreen = Screen.Auth::class.simpleName.orEmpty() if ( isAuth.not() && - currentScreen?.route?.contains(authScreen) == true + currentScreen != null && + currentScreen.route?.contains(authScreen) == true ) { navHostController.navigate(Screen.Auth) } @@ -75,12 +76,10 @@ fun InitialApp( } } ) { _ -> - Box( - modifier = Modifier.fillMaxSize() - ) { + Box(modifier = Modifier.fillMaxSize()) { AppNavigationHost( navHostController = navHostController, - startScreen = if (userStore.isAuth) Screen.Auth else Screen.FilmFeed + startScreen = if (userStore.isAuth) Screen.FilmFeed else Screen.Auth ) } } diff --git a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/server/model/ErrorRefresh.kt b/core/core/src/commonMain/kotlin/com/stslex/wizard/core/core/error/ErrorRefresh.kt similarity index 77% rename from core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/server/model/ErrorRefresh.kt rename to core/core/src/commonMain/kotlin/com/stslex/wizard/core/core/error/ErrorRefresh.kt index d680b4f..b9e36b7 100644 --- a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/server/model/ErrorRefresh.kt +++ b/core/core/src/commonMain/kotlin/com/stslex/wizard/core/core/error/ErrorRefresh.kt @@ -1,4 +1,4 @@ -package com.stslex.wizard.core.network.api.server.model +package com.stslex.wizard.core.core.error /** * Error refresh token response diff --git a/core/network/build.gradle.kts b/core/network/build.gradle.kts index de19806..5e234e6 100644 --- a/core/network/build.gradle.kts +++ b/core/network/build.gradle.kts @@ -14,7 +14,7 @@ kotlin { implementation(project(":core:database")) implementation(libs.bundles.ktor) implementation(libs.slf4j.simple) - implementation(libs.kamel) + implementation(libs.kotlinx.datetime) } buildConfig { setLocalProperty(project.rootProject) diff --git a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/server/error_handler/RefreshTokenValidator.kt b/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/server/error_handler/RefreshTokenValidator.kt index 9d89e32..192f9a7 100644 --- a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/server/error_handler/RefreshTokenValidator.kt +++ b/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/api/server/error_handler/RefreshTokenValidator.kt @@ -1,6 +1,6 @@ package com.stslex.wizard.core.network.api.server.error_handler -import com.stslex.wizard.core.network.api.server.model.ErrorRefresh +import com.stslex.wizard.core.core.error.ErrorRefresh import io.ktor.client.HttpClient import io.ktor.client.plugins.CallRequestExceptionHandler import io.ktor.client.plugins.HttpResponseValidator diff --git a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/match/client/MockMatchClientImpl.kt b/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/match/client/MockMatchClientImpl.kt index f6bc4d2..b12d00e 100644 --- a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/match/client/MockMatchClientImpl.kt +++ b/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/clients/match/client/MockMatchClientImpl.kt @@ -7,8 +7,8 @@ import com.stslex.wizard.core.network.clients.match.model.response.MatchResponse import com.stslex.wizard.core.network.clients.match.model.response.MatchStatusResponse import com.stslex.wizard.core.network.clients.match.model.response.MatchUserResponse import com.stslex.wizard.core.network.model.PagingRequest -import com.stslex.wizard.core.network.utils.currentTimeMs import kotlinx.coroutines.delay +import kotlinx.datetime.Clock class MockMatchClientImpl : MatchClient { @@ -62,7 +62,7 @@ class MockMatchClientImpl : MatchClient { } private fun createMatch(index: Int): MatchDetailResponse { - val created = currentTimeMs + val created = Clock.System.now().epochSeconds val updated = created + 1000 * 60 * 60 val expires = created + 1000 * 60 * 60 * 24 return MatchDetailResponse( diff --git a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/utils/AppKamelConfig.kt b/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/utils/AppKamelConfig.kt deleted file mode 100644 index 58c8439..0000000 --- a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/utils/AppKamelConfig.kt +++ /dev/null @@ -1,22 +0,0 @@ -package com.stslex.wizard.core.network.utils - -import io.kamel.core.config.KamelConfig -import io.kamel.core.config.httpFetcher -import io.kamel.core.config.takeFrom -import io.kamel.image.config.Default -import io.ktor.client.plugins.logging.LogLevel -import io.ktor.client.plugins.logging.Logging - -object AppKamelConfig { - - val KamelLoggingConfig: KamelConfig - get() = KamelConfig { - takeFrom(KamelConfig.Default) - httpFetcher { - install(Logging) { - logger = KtorLogger - level = LogLevel.ALL - } - } - } -} \ No newline at end of file diff --git a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/utils/KtorExt.kt b/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/utils/KtorExt.kt deleted file mode 100644 index 5428390..0000000 --- a/core/network/src/commonMain/kotlin/com/stslex/wizard/core/network/utils/KtorExt.kt +++ /dev/null @@ -1,6 +0,0 @@ -package com.stslex.wizard.core.network.utils - -import io.ktor.util.date.getTimeMillis - -val currentTimeMs: Long - get() = getTimeMillis() \ No newline at end of file diff --git a/core/ui/build.gradle.kts b/core/ui/build.gradle.kts index 355dc72..ed34ed6 100644 --- a/core/ui/build.gradle.kts +++ b/core/ui/build.gradle.kts @@ -7,13 +7,16 @@ kotlin { commonMain.dependencies { implementation(project(":core:core")) implementation(project(":core:network")) - } - androidMain.dependencies { - api(libs.coil.compose) + implementation(libs.kotlinx.datetime) + implementation(libs.bundles.coil) + implementation(libs.bundles.ktor) + implementation(libs.slf4j.simple) } iosMain.dependencies { - // TODO research TLS PROBLEM - implementation(libs.ktor.client.darwin) + api(libs.ktor.client.darwin) + } + androidMain.dependencies { + api(libs.ktor.client.android) } } } diff --git a/core/ui/src/androidMain/kotlin/com/stslex/wizard/core/ui/base/image/NativeNetworkImage.android.kt b/core/ui/src/androidMain/kotlin/com/stslex/wizard/core/ui/base/image/NativeNetworkImage.android.kt deleted file mode 100644 index 1a9c9c4..0000000 --- a/core/ui/src/androidMain/kotlin/com/stslex/wizard/core/ui/base/image/NativeNetworkImage.android.kt +++ /dev/null @@ -1,31 +0,0 @@ -package com.stslex.wizard.core.ui.base.image - -import androidx.compose.runtime.Composable -import androidx.compose.ui.Modifier -import androidx.compose.ui.graphics.FilterQuality -import androidx.compose.ui.layout.ContentScale -import coil.compose.AsyncImage -import coil.compose.AsyncImagePainter -import com.stslex.wizard.core.core.Logger - -@Composable -actual fun NativeNetworkImage( - url: String, - contentDescription: String?, - contentScale: ContentScale, - modifier: Modifier -) { - AsyncImage( - modifier = modifier, - model = url, - contentDescription = contentDescription, - contentScale = contentScale, - onState = { state -> - Logger.d("state: $state", "NativeNetworkImage") - if (state is AsyncImagePainter.State.Error) { - Logger.e(state.result.throwable, "NativeNetworkImage") - } - }, - filterQuality = FilterQuality.None - ) -} \ No newline at end of file diff --git a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/base/AppError.kt b/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/base/AppError.kt index 9688323..f74f37e 100644 --- a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/base/AppError.kt +++ b/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/base/AppError.kt @@ -1,7 +1,7 @@ package com.stslex.wizard.core.ui.base import androidx.compose.runtime.Stable -import com.stslex.wizard.core.network.api.server.model.ErrorRefresh +import com.stslex.wizard.core.core.error.ErrorRefresh @Stable sealed class AppError(open val message: String) { diff --git a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/base/Clicker.kt b/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/base/Clicker.kt index 8a6fd22..9c7f9ba 100644 --- a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/base/Clicker.kt +++ b/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/base/Clicker.kt @@ -3,9 +3,9 @@ package com.stslex.wizard.core.ui.base import androidx.compose.runtime.Composable import androidx.compose.runtime.remember import androidx.compose.runtime.rememberCoroutineScope -import com.stslex.wizard.core.network.utils.currentTimeMs import kotlinx.coroutines.delay import kotlinx.coroutines.launch +import kotlinx.datetime.Clock private class Clicker( private val throttle: Long = 500 @@ -14,7 +14,7 @@ private class Clicker( private var lastClickTime = 0L fun click(onClick: () -> Unit) { - val currentTime = currentTimeMs + val currentTime = Clock.System.now().epochSeconds if (currentTime - lastClickTime < throttle) { return } diff --git a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/base/image/AppImage.kt b/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/base/image/AppImage.kt new file mode 100644 index 0000000..cc79474 --- /dev/null +++ b/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/base/image/AppImage.kt @@ -0,0 +1,51 @@ +package com.stslex.wizard.core.ui.base.image + +import androidx.compose.foundation.Image +import androidx.compose.foundation.layout.BoxScope +import androidx.compose.runtime.Composable +import androidx.compose.runtime.remember +import androidx.compose.ui.Modifier +import androidx.compose.ui.layout.ContentScale +import coil3.ImageLoader +import coil3.compose.LocalPlatformContext +import coil3.compose.rememberAsyncImagePainter +import coil3.network.ktor3.KtorNetworkFetcherFactory +import io.ktor.client.HttpClient +import io.ktor.client.engine.cio.CIO + +// todo refactor +private var imageLoader: ImageLoader? = null + +@Composable +internal fun rememberImageLoader(): ImageLoader { + val platformContext = LocalPlatformContext.current + return remember { + imageLoader ?: ImageLoader + .Builder(platformContext) + .components { add(KtorNetworkFetcherFactory(HttpClient(CIO))) } + .build() + } +} + +@Composable +fun AppImage( + url: String, + modifier: Modifier = Modifier, + contentDescription: String? = null, + contentScale: ContentScale = ContentScale.Fit, + onLoading: @Composable (BoxScope.(Float) -> Unit)? = null, + onFailure: @Composable (BoxScope.(Throwable) -> Unit)? = null, +) { + val imageLoader = rememberImageLoader() + val painter = rememberAsyncImagePainter( + model = url, + imageLoader = imageLoader, + ) + // todo add states + Image( + modifier = modifier, + painter = painter, + contentDescription = contentDescription, + contentScale = contentScale + ) +} diff --git a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/base/image/KamelNetworkImage.kt b/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/base/image/KamelNetworkImage.kt deleted file mode 100644 index 19703e2..0000000 --- a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/base/image/KamelNetworkImage.kt +++ /dev/null @@ -1,33 +0,0 @@ -package com.stslex.wizard.core.ui.base.image - -import androidx.compose.foundation.layout.BoxScope -import androidx.compose.runtime.Composable -import androidx.compose.ui.Modifier -import androidx.compose.ui.layout.ContentScale -import com.stslex.wizard.core.core.Logger -import io.kamel.image.KamelImage -import io.kamel.image.asyncPainterResource - -@Composable -internal fun KamelNetworkImage( - url: String, - contentDescription: String?, - contentScale: ContentScale, - modifier: Modifier = Modifier, - onLoading: @Composable (BoxScope.(Float) -> Unit)? = null, - onFailure: @Composable (BoxScope.(Throwable) -> Unit)? = null, -) { - KamelImage( - modifier = modifier, - resource = asyncPainterResource(data = url), - contentDescription = contentDescription, - contentScale = contentScale, - onLoading = onLoading, - onFailure = { throwable -> - Logger.e(throwable) - onFailure?.let { onFailure -> - onFailure(throwable) - } - } - ) -} \ No newline at end of file diff --git a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/base/image/NativeNetworkImage.kt b/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/base/image/NativeNetworkImage.kt deleted file mode 100644 index 64c8c4a..0000000 --- a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/base/image/NativeNetworkImage.kt +++ /dev/null @@ -1,13 +0,0 @@ -package com.stslex.wizard.core.ui.base.image - -import androidx.compose.runtime.Composable -import androidx.compose.ui.Modifier -import androidx.compose.ui.layout.ContentScale - -@Composable -expect fun NativeNetworkImage( - url: String, - contentDescription: String?, - contentScale: ContentScale, - modifier: Modifier = Modifier, -) diff --git a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/base/image/NetworkImage.kt b/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/base/image/NetworkImage.kt deleted file mode 100644 index a9eefae..0000000 --- a/core/ui/src/commonMain/kotlin/com/stslex/wizard/core/ui/base/image/NetworkImage.kt +++ /dev/null @@ -1,35 +0,0 @@ -package com.stslex.wizard.core.ui.base.image - -import androidx.compose.foundation.layout.BoxScope -import androidx.compose.runtime.Composable -import androidx.compose.ui.Modifier -import androidx.compose.ui.layout.ContentScale - -@Composable -fun NetworkImage( - url: String, - modifier: Modifier = Modifier, - imageType: ImageType = ImageType.KAMEL, - contentDescription: String? = null, - contentScale: ContentScale = ContentScale.Fit, - onLoading: @Composable (BoxScope.(Float) -> Unit)? = null, - onFailure: @Composable (BoxScope.(Throwable) -> Unit)? = null, -) { - when (imageType) { - ImageType.NATIVE -> NativeNetworkImage( - modifier = modifier, - url = url, - contentDescription = contentDescription, - contentScale = contentScale - ) - - ImageType.KAMEL -> KamelNetworkImage( - modifier = modifier, - url = url, - contentDescription = contentDescription, - contentScale = contentScale, - onLoading = onLoading, - onFailure = onFailure - ) - } -} diff --git a/core/ui/src/iosMain/kotlin/com/stslex/wizard/core/ui/base/image/NativeNetworkImage.ios.kt b/core/ui/src/iosMain/kotlin/com/stslex/wizard/core/ui/base/image/NativeNetworkImage.ios.kt deleted file mode 100644 index b997d89..0000000 --- a/core/ui/src/iosMain/kotlin/com/stslex/wizard/core/ui/base/image/NativeNetworkImage.ios.kt +++ /dev/null @@ -1,21 +0,0 @@ -package com.stslex.wizard.core.ui.base.image - -import androidx.compose.runtime.Composable -import androidx.compose.ui.Modifier -import androidx.compose.ui.layout.ContentScale - -@Composable -actual fun NativeNetworkImage( - url: String, - contentDescription: String?, - contentScale: ContentScale, - modifier: Modifier -) { - // TODO implement - KamelNetworkImage( - url = url, - contentDescription = contentDescription, - contentScale = contentScale, - modifier = modifier - ) -} \ No newline at end of file diff --git a/feature/film/src/commonMain/kotlin/com/stslex/wizard/feature/film/ui/components/FilmContentScreen.kt b/feature/film/src/commonMain/kotlin/com/stslex/wizard/feature/film/ui/components/FilmContentScreen.kt index 4273584..e7a79c7 100644 --- a/feature/film/src/commonMain/kotlin/com/stslex/wizard/feature/film/ui/components/FilmContentScreen.kt +++ b/feature/film/src/commonMain/kotlin/com/stslex/wizard/feature/film/ui/components/FilmContentScreen.kt @@ -53,7 +53,7 @@ import androidx.compose.ui.unit.TextUnit import androidx.compose.ui.unit.dp import com.stslex.wizard.core.ui.base.SwipeScrollConnection import com.stslex.wizard.core.ui.base.SwipeState -import com.stslex.wizard.core.ui.base.image.NetworkImage +import com.stslex.wizard.core.ui.base.image.AppImage import com.stslex.wizard.core.ui.base.onClick import com.stslex.wizard.core.ui.base.onClickDelay import com.stslex.wizard.core.ui.theme.AppDimension @@ -408,7 +408,7 @@ internal fun FilmHeader( title: String, modifier: Modifier = Modifier, ) { - NetworkImage( + AppImage( modifier = modifier .fillMaxWidth(), url = url, diff --git a/feature/film_feed/src/commonMain/kotlin/com/stslex/wizard/feature/film_feed/ui/FeedScreen.kt b/feature/film_feed/src/commonMain/kotlin/com/stslex/wizard/feature/film_feed/ui/FeedScreen.kt index f70edcd..aeff623 100644 --- a/feature/film_feed/src/commonMain/kotlin/com/stslex/wizard/feature/film_feed/ui/FeedScreen.kt +++ b/feature/film_feed/src/commonMain/kotlin/com/stslex/wizard/feature/film_feed/ui/FeedScreen.kt @@ -2,6 +2,7 @@ package com.stslex.wizard.feature.film_feed.ui import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.statusBarsPadding import androidx.compose.runtime.Composable import androidx.compose.runtime.remember import androidx.compose.ui.Modifier @@ -19,7 +20,9 @@ internal fun FeedScreen( sendAction: (Action) -> Unit, ) { Box( - modifier = modifier.fillMaxSize() + modifier = modifier + .fillMaxSize() + .statusBarsPadding() ) { when (val screenState = state.screen) { is ScreenState.Content -> FeedScreenContent( diff --git a/feature/film_feed/src/commonMain/kotlin/com/stslex/wizard/feature/film_feed/ui/components/FeedScreenFilmItem.kt b/feature/film_feed/src/commonMain/kotlin/com/stslex/wizard/feature/film_feed/ui/components/FeedScreenFilmItem.kt index 99c4f02..32dca61 100644 --- a/feature/film_feed/src/commonMain/kotlin/com/stslex/wizard/feature/film_feed/ui/components/FeedScreenFilmItem.kt +++ b/feature/film_feed/src/commonMain/kotlin/com/stslex/wizard/feature/film_feed/ui/components/FeedScreenFilmItem.kt @@ -23,7 +23,7 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.unit.Dp -import com.stslex.wizard.core.ui.base.image.NetworkImage +import com.stslex.wizard.core.ui.base.image.AppImage import com.stslex.wizard.core.ui.base.onClickDelay import com.stslex.wizard.core.ui.theme.AppDimension import com.stslex.wizard.feature.film_feed.ui.model.FilmModel @@ -103,7 +103,7 @@ internal fun FeedItemFilmPreview( url: String, description: String ) { - NetworkImage( + AppImage( modifier = modifier, url = url, contentDescription = description, diff --git a/feature/match_feed/src/commonMain/kotlin/com/stslex/wizard/feature/match_feed/ui/components/MatchFeedScreenFilmItem.kt b/feature/match_feed/src/commonMain/kotlin/com/stslex/wizard/feature/match_feed/ui/components/MatchFeedScreenFilmItem.kt index 60c8a68..96d54e8 100644 --- a/feature/match_feed/src/commonMain/kotlin/com/stslex/wizard/feature/match_feed/ui/components/MatchFeedScreenFilmItem.kt +++ b/feature/match_feed/src/commonMain/kotlin/com/stslex/wizard/feature/match_feed/ui/components/MatchFeedScreenFilmItem.kt @@ -35,7 +35,7 @@ import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.unit.Dp -import com.stslex.wizard.core.ui.base.image.NetworkImage +import com.stslex.wizard.core.ui.base.image.AppImage import com.stslex.wizard.core.ui.base.onClickDelay import com.stslex.wizard.core.ui.theme.AppDimension import com.stslex.wizard.feature.match_feed.ui.model.FilmUi @@ -214,7 +214,7 @@ internal fun FeedItemFilmPreview( url: String, description: String ) { - NetworkImage( + AppImage( modifier = modifier, url = url, contentDescription = description, diff --git a/feature/profile/src/commonMain/kotlin/com/stslex/wizard/feature/profile/ui/ProfileScreen.kt b/feature/profile/src/commonMain/kotlin/com/stslex/wizard/feature/profile/ui/ProfileScreen.kt index b3f7b08..fff1760 100644 --- a/feature/profile/src/commonMain/kotlin/com/stslex/wizard/feature/profile/ui/ProfileScreen.kt +++ b/feature/profile/src/commonMain/kotlin/com/stslex/wizard/feature/profile/ui/ProfileScreen.kt @@ -15,7 +15,7 @@ import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier -import com.stslex.wizard.core.network.api.server.model.ErrorRefresh +import com.stslex.wizard.core.core.error.ErrorRefresh import com.stslex.wizard.core.ui.components.AppSnackbarHost import com.stslex.wizard.core.ui.theme.AppDimension import com.stslex.wizard.feature.profile.ui.components.ProfileScreenContent diff --git a/feature/profile/src/commonMain/kotlin/com/stslex/wizard/feature/profile/ui/components/ProfileAvatar.kt b/feature/profile/src/commonMain/kotlin/com/stslex/wizard/feature/profile/ui/components/ProfileAvatar.kt index b2b4485..2bf7731 100644 --- a/feature/profile/src/commonMain/kotlin/com/stslex/wizard/feature/profile/ui/components/ProfileAvatar.kt +++ b/feature/profile/src/commonMain/kotlin/com/stslex/wizard/feature/profile/ui/components/ProfileAvatar.kt @@ -9,7 +9,7 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip -import com.stslex.wizard.core.ui.base.image.NetworkImage +import com.stslex.wizard.core.ui.base.image.AppImage import com.stslex.wizard.core.ui.theme.AppDimension import com.stslex.wizard.feature.profile.ui.model.ProfileAvatarModel @@ -24,7 +24,7 @@ fun ProfileAvatar( when (avatar) { is ProfileAvatarModel.Content -> { - NetworkImage( + AppImage( url = avatar.url, modifier = avatarModifier ) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 9f4d8eb..b169b5e 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -18,25 +18,25 @@ material = "1.12.0" ksp = "2.0.20-1.0.25" # https://github.com/google/ksp/releases room = "2.7.0-alpha11" sqlite = "2.5.0-alpha07" -koin = "3.5.6" -koin-compose = "1.1.5" -koin-ksp = "1.3.1" +koin = "4.0.0" +koin-compose = "4.0.0" +koin-ksp = "1.4.0" compose-compiler = "1.5.4" junit = "4.13.2" -ktor = "2.3.6" +ktor = "3.0.1" immutableCollection = "0.3.5" -coroutine = "1.8.1" +coroutine = "1.9.0" kermit = "2.0.3" -kamel = "0.9.0" -coil = "2.5.0" +coil = "3.0.2" navigation = "2.8.0-alpha10" lifecycle = "2.8.2" mockito = "2.19.0" multiplatformSettings = "1.1.1" -serialization = "1.7.1" +serialization = "1.7.3" +kotlinxDatetime = "0.6.0" buildConfig = "4.2.0" [libraries] @@ -66,13 +66,13 @@ koin-ksp-compiler = { group = "io.insert-koin", name = "koin-ksp-compiler", vers koin-annotations = { group = "io.insert-koin", name = "koin-annotations", version.ref = "koin-ksp" } koin-compose = { group = "io.insert-koin", name = "koin-compose", version.ref = "koin-compose" } -ktor-client-darwin = { module = "io.ktor:ktor-client-darwin", version.ref = "ktor" } +coil-compose = { module = "io.coil-kt.coil3:coil-compose", version.ref = "coil" } +coil-ktor = { module = "io.coil-kt.coil3:coil-network-ktor3", version.ref = "coil" } -kamel = { module = "media.kamel:kamel-image", version.ref = "kamel" } -coil-compose = { module = "io.coil-kt:coil-compose", version.ref = "coil" } kermit = { module = "co.touchlab:kermit", version.ref = "kermit" } multiplatformSettings = { module = "com.russhwolf:multiplatform-settings", version.ref = "multiplatformSettings" } kotlinx-collections-immutable = { group = "org.jetbrains.kotlinx", name = "kotlinx-collections-immutable", version.ref = "immutableCollection" } +kotlinx-datetime = { group = "org.jetbrains.kotlinx", name = "kotlinx-datetime", version.ref = "kotlinxDatetime" } ktor-client-core = { module = "io.ktor:ktor-client-core", version.ref = "ktor" } ktor-client-content-negotiation = { module = "io.ktor:ktor-client-content-negotiation", version.ref = "ktor" } @@ -80,6 +80,8 @@ ktor-serialization-kotlinx-json = { module = "io.ktor:ktor-serialization-kotlinx ktor-client-logging = { module = "io.ktor:ktor-client-logging", version.ref = "ktor" } ktor-client-cio = { module = "io.ktor:ktor-client-cio", version.ref = "ktor" } ktor-client-auth = { group = "io.ktor", name = "ktor-client-auth", version.ref = "ktor" } +ktor-client-darwin = { module = "io.ktor:ktor-client-darwin", version.ref = "ktor" } +ktor-client-android = { module = "io.ktor:ktor-client-android", version.ref = "ktor" } lifecycle-viewmodel = { group = "org.jetbrains.androidx.lifecycle", name = "lifecycle-viewmodel-compose", version.ref = "lifecycle" } kotlinx-serialization-json = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "serialization" } @@ -129,4 +131,8 @@ ktor = [ "ktor-client-logging", "ktor-client-auth", "slf4j-simple", +] +coil = [ + "coil-compose", + "coil-ktor", ] \ No newline at end of file