Skip to content

Commit

Permalink
🔧 Compose ImageLoader に乗り換え
Browse files Browse the repository at this point in the history
  • Loading branch information
tatsutakein committed Dec 5, 2023
1 parent a82bf48 commit 6f094ed
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 61 deletions.
1 change: 1 addition & 0 deletions core/designsystem/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ kotlin {
sourceSets {
commonMain {
dependencies {
api(libs.imageLoader)
}
}
}
Expand Down
5 changes: 0 additions & 5 deletions core/ui/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,5 @@ kotlin {
implementation(libs.kermit)
}
}
androidMain {
dependencies {
implementation(libs.composeCoil)
}
}
}
}

This file was deleted.

18 changes: 16 additions & 2 deletions core/ui/src/commonMain/kotlin/club/nito/core/ui/ProfileImage.kt
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
package club.nito.core.ui

import androidx.compose.foundation.Image
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.layout.ContentScale
import club.nito.core.model.UserProfile
import com.seiko.imageloader.rememberImagePainter

@Composable
public expect fun ProfileImage(
public fun ProfileImage(
profile: UserProfile,
modifier: Modifier = Modifier,
)
) {
Image(
painter = rememberImagePainter(
url = profile.avatarUrl,
),
contentDescription = profile.displayName,
contentScale = ContentScale.Crop,
modifier = modifier.clip(CircleShape),
)
}
Empty file.
15 changes: 0 additions & 15 deletions core/ui/src/iosMain/kotlin/club/nito/core/ui/ProfileImage.ios.kt

This file was deleted.

Empty file.

This file was deleted.

3 changes: 2 additions & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ logback = "1.4.14"
graphqlKotlin = "7.0.2"
kotest = "5.8.0"
precompose = "1.5.8"
imageLoader = "1.7.1"

[libraries]
androidGradlePlugin = { group = "com.android.tools.build", name = "gradle", version.ref = "androidGradlePlugin" }
Expand Down Expand Up @@ -60,7 +61,7 @@ kotlinxCollectionsImmutable = { module = "org.jetbrains.kotlinx:kotlinx-collecti
kotlinxDatetime = { module = "org.jetbrains.kotlinx:kotlinx-datetime", version = "0.5.0" }
kotlinxAtomicfu = { module = "org.jetbrains.kotlinx:atomicfu", version = "0.23.1" }

composeCoil = { module = "io.coil-kt:coil-compose", version = "2.5.0" }
imageLoader = { module = "io.github.qdsfdhvh:image-loader", version.ref = "imageLoader" }

androidxActivityActivityCompose = { module = "androidx.activity:activity-compose", version.ref = "androidxActivity" }
androidxDatastoreDatastorePreferences = { module = "androidx.datastore:datastore-preferences-core", version = "1.1.0-alpha06" }
Expand Down

0 comments on commit 6f094ed

Please sign in to comment.