Skip to content

Commit 06ede59

Browse files
committed
chore(!fixup): Use coil for profile pic view
1 parent 846e79f commit 06ede59

File tree

1 file changed

+11
-7
lines changed
  • composeApp/src/commonMain/kotlin/dev/ishubhamsingh/splashy/features/details/ui

1 file changed

+11
-7
lines changed

composeApp/src/commonMain/kotlin/dev/ishubhamsingh/splashy/features/details/ui/DetailsScreen.kt

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ package dev.ishubhamsingh.splashy.features.details.ui
1717

1818
import androidx.compose.animation.AnimatedVisibility
1919
import androidx.compose.animation.Crossfade
20-
import androidx.compose.animation.core.tween
2120
import androidx.compose.foundation.background
2221
import androidx.compose.foundation.layout.Arrangement
2322
import androidx.compose.foundation.layout.Box
@@ -77,6 +76,9 @@ import cafe.adriel.voyager.core.model.rememberScreenModel
7776
import cafe.adriel.voyager.core.screen.Screen
7877
import cafe.adriel.voyager.navigator.LocalNavigator
7978
import cafe.adriel.voyager.navigator.currentOrThrow
79+
import coil3.compose.AsyncImage
80+
import coil3.compose.LocalPlatformContext
81+
import coil3.request.ImageRequest
8082
import compose.icons.EvaIcons
8183
import compose.icons.evaicons.Fill
8284
import compose.icons.evaicons.Outline
@@ -119,8 +121,6 @@ import dev.ishubhamsingh.splashy.ui.components.ImageViewComponent
119121
import dev.ishubhamsingh.splashy.ui.components.parseColor
120122
import dev.ishubhamsingh.splashy.ui.theme.getLatoBold
121123
import dev.ishubhamsingh.splashy.ui.theme.getLatoRegular
122-
import io.kamel.image.KamelImage
123-
import io.kamel.image.asyncPainterResource
124124
import org.jetbrains.compose.resources.stringResource
125125

126126
data class DetailsScreen(
@@ -314,12 +314,16 @@ data class DetailsScreen(
314314
) {
315315
Row(verticalAlignment = Alignment.CenterVertically) {
316316
user?.profileImage?.let { profilePic ->
317-
KamelImage(
317+
AsyncImage(
318+
model =
319+
ImageRequest.Builder(LocalPlatformContext.current)
320+
.data(profilePic.medium)
321+
.diskCacheKey(profilePic.medium)
322+
.memoryCacheKey(profilePic.medium)
323+
.build(),
318324
modifier = Modifier.size(36.dp).clip(CircleShape),
319-
resource = asyncPainterResource(data = profilePic.medium),
320325
contentDescription = user.name,
321-
contentScale = ContentScale.Crop,
322-
animationSpec = tween()
326+
contentScale = ContentScale.Crop
323327
)
324328
}
325329

0 commit comments

Comments
 (0)