Skip to content

Commit

Permalink
fix(MyKSuiteDashboard): Fix coil not downloading avatar
Browse files Browse the repository at this point in the history
  • Loading branch information
FabianDevel committed Feb 3, 2025
1 parent 744ebdd commit 8dbbfdd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions MykSuite/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ dependencies {

// Compose
implementation(core.coil.compose)
implementation(core.coil.network.okhttp)
implementation(platform(core.compose.bom))
implementation(core.compose.runtime)
debugImplementation(core.compose.ui.tooling)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@ import android.content.res.Configuration
import androidx.compose.foundation.border
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.material3.Icon
import androidx.compose.material3.Surface
import androidx.compose.runtime.*
import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.graphics.Brush
import androidx.compose.ui.graphics.Color
Expand All @@ -49,7 +50,7 @@ fun UserAvatar(avatarUri: String) {
val context = LocalContext.current
var shouldDisplayPreview by rememberSaveable(avatarUri) { mutableStateOf(true) }

Box {
Box(Modifier.clip(CircleShape)) {
if (shouldDisplayPreview) {
val imageRequest = remember(avatarUri) {
ImageRequest.Builder(context)
Expand Down Expand Up @@ -87,7 +88,7 @@ private fun DefaultAvatar() {
start = Offset(0.0f, 10.0f),
end = Offset(0.0f, 90.0f),
),
shape = RoundedCornerShape(Dimens.largeCornerRadius),
shape = CircleShape,
),
imageVector = ImageVector.vectorResource(R.drawable.ic_person),
contentDescription = null,
Expand Down
2 changes: 2 additions & 0 deletions gradle/core.versions.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[versions]
androidxCore = "1.13.1" # Doesn't build when bumped to 1.15.0 (Waiting SDK 35)
coil = "3.0.2"
coilNetworkOkhttp = "3.0.4"
composeBom = "2024.12.01"
integrity = "1.4.0"
junit = "4.13.2"
Expand All @@ -22,6 +23,7 @@ androidx-core = { group = "androidx.core", name = "core", version.ref = "android
androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "androidxCore" }
androidx-lifecycle-runtime-ktx = { group = "androidx.lifecycle", name = "lifecycle-runtime-ktx", version.ref = "lifecycleRuntimeKtx" }
coil-compose = { module = "io.coil-kt.coil3:coil-compose", version.ref = "coil" }
coil-network-okhttp = { module = "io.coil-kt.coil3:coil-network-okhttp", version.ref = "coilNetworkOkhttp" }
compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "composeBom" }
compose-foundation = { group = "androidx.compose.foundation", name = "foundation" }
compose-material3 = { group = "androidx.compose.material3", name = "material3" }
Expand Down

0 comments on commit 8dbbfdd

Please sign in to comment.