Update coil to 3.0.0-alpha02

This commit is contained in:
FooIbar committed 2024-01-10 21:10:40 +08:00
1 parent e28efc1f50
commit 5285e1ccf2
4 files changed
+4 -12

No files matched your search

@@ -29,8 +29,7 @@ import androidx.lifecycle.ProcessLifecycleOwner
import androidx.lifecycle.coroutineScope
import coil3.SingletonImageLoader
import coil3.asCoilImage
import coil3.gif.AnimatedImageDecoderDecoder
import coil3.gif.GifDecoder
import coil3.gif.AnimatedImageDecoder
import coil3.network.NetworkFetcher
import coil3.request.crossfade
import coil3.serviceLoaderEnabled
@@ -189,9 +188,7 @@ class EhApplication : Application(), SingletonImageLoader.Factory {
add(MergeInterceptor)
add(DownloadThumbInterceptor)
if (isAtLeastP) {
add(AnimatedImageDecoderDecoder.Factory(false))
} else {
add(GifDecoder.Factory())
add(AnimatedImageDecoder.Factory(false))
}
}
diskCache(imageCache)
@@ -109,11 +109,7 @@ class Image private constructor(image: CoilImage, private val src: AutoCloseable
private suspend fun Either<ByteBufferSource, UniFileSource>.decodeCoil(): CoilImage {
val req = appCtx.imageRequest {
onLeft { data(it.source) }
onRight {
// Workaround https://github.com/coil-kt/coil/issues/2006
val uri = it.source.uri
data(if (UniFile.isFileUri(uri)) uri.path else uri)
}
onRight { data(it.source.uri) }
size(targetWidth, targetHeight)
scale(Scale.FILL)
precision(Precision.INEXACT)
+1 -1
View File
@@ -16,7 +16,7 @@ androidx-recyclerview = "1.3.2"
androidx-room = "2.6.1"
androidx-work = "2.9.0"
arrow = "1.2.1"
coil = "3.0.0-SNAPSHOT"
coil = "3.0.0-alpha02"
compose-bom = "2023.12.00-alpha04"
compose-compiler = "1.5.8-dev-k2.0.0-Beta2-99ed868a0f8"
compose-destinations = "1.9.57"
-1
View File
@@ -12,7 +12,6 @@ dependencyResolutionManagement {
repositories {
google()
mavenCentral()
maven("https://oss.sonatype.org/content/repositories/snapshots")
maven("https://jitpack.io")
maven("https://androidx.dev/storage/compose-compiler/repository/")
maven("https://androidx.dev/snapshots/builds/11271125/artifacts/repository")