Skip to content

Commit

Permalink
Merge pull request #1228 from joreilly/coil3_updates
Browse files Browse the repository at this point in the history
Use just coil3 for iamge loading/rendering in shared code
  • Loading branch information
joreilly authored Apr 2, 2024
2 parents d4400ef + 7e85840 commit 647b4a8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 32 deletions.
2 changes: 0 additions & 2 deletions shared/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ kotlin {
api(libs.decompose.decompose)
api("com.arkivanov.decompose:decompose:2.2.2-compose-experimental")
api("com.arkivanov.decompose:extensions-compose-jetbrains:2.2.2-compose-experimental")
//implementation("com.arkivanov.decompose:extensions-compose-jetbrains:2.2.2")

api(libs.essenty.lifecycle)

Expand All @@ -88,7 +87,6 @@ kotlin {
implementation(compose.foundation)
implementation(compose.material3)
implementation(compose.components.resources)
implementation(libs.image.loader)
implementation(libs.coil3.compose)
implementation(libs.coil3.network.ktor)
api(libs.materialkolor)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package dev.johnoreilly.confetti.ui

import androidx.compose.foundation.Image
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
Expand All @@ -19,7 +18,6 @@ import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.verticalScroll
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Person
import androidx.compose.material3.CircularProgressIndicator
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.MaterialTheme
Expand All @@ -34,13 +32,10 @@ import androidx.compose.ui.semantics.Role
import androidx.compose.ui.text.font.FontStyle
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import com.seiko.imageloader.model.ImageAction
import com.seiko.imageloader.rememberImageSuccessPainter
import com.seiko.imageloader.ui.AutoSizeBox
import coil3.compose.AsyncImage
import confetti.shared.generated.resources.Res
import confetti.shared.generated.resources.facebook
import confetti.shared.generated.resources.github
import confetti.shared.generated.resources.ic_person_black_24dp
import confetti.shared.generated.resources.linkedin
import confetti.shared.generated.resources.twitter
import confetti.shared.generated.resources.web
Expand Down Expand Up @@ -149,30 +144,13 @@ internal fun SessionSpeakerInfo(
) {
Row {
speaker.photoUrl?.let {
AutoSizeBox(speaker.photoUrl) { action ->
when (action) {
is ImageAction.Success -> {
Image(
rememberImageSuccessPainter(action), null,
modifier = Modifier.size(64.dp).clip(CircleShape),
contentScale = ContentScale.Crop,
)
}
is ImageAction.Loading -> {
CircularProgressIndicator()
}
is ImageAction.Failure -> {
Image(
painter = painterResource(Res.drawable.ic_person_black_24dp),
contentDescription = speaker.name,
contentScale = ContentScale.Fit,
modifier = Modifier.size(64.dp).clip(CircleShape)
)
}
}
}


AsyncImage(
model = speaker.photoUrl,
contentDescription = speaker.name,
contentScale = ContentScale.Crop,
modifier = Modifier.size(64.dp)
.clip(CircleShape)
)
}

Column(Modifier.padding(horizontal = 8.dp)) {
Expand Down

0 comments on commit 647b4a8

Please sign in to comment.