Skip to content

Commit

Permalink
Update to Coil v1.0.0-rc1
Browse files Browse the repository at this point in the history
Also fixed the logic for detecting whether a custom
SizeResolver has been set. Thanks for the
hint @colinrtwhite
  • Loading branch information
chrisbanes committed Aug 21, 2020
1 parent 0920ada commit c62c8c9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 2 additions & 0 deletions build.gradle
Expand Up @@ -79,6 +79,8 @@ subprojects {
freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn"

freeCompilerArgs += "-Xallow-jvm-ir-dependencies"
// Turn on JVM default methods
freeCompilerArgs += "-Xjvm-default=all"
}
}

Expand Down
Expand Up @@ -71,7 +71,7 @@ object Libs {
const val appcompat = "androidx.appcompat:appcompat:1.3.0-alpha02"
}

const val coil = "io.coil-kt:coil:0.12.0"
const val coil = "io.coil-kt:coil:1.0.0-rc1"

const val truth = "com.google.truth:truth:1.0.1"
}
6 changes: 2 additions & 4 deletions coil/src/main/java/dev/chrisbanes/accompanist/coil/Coil.kt
Expand Up @@ -44,7 +44,6 @@ import coil.Coil
import coil.decode.DataSource
import coil.request.ImageRequest
import coil.request.ImageResult
import coil.size.DisplaySizeResolver

/**
* Creates a composable that will attempt to load the given [data] using [Coil], and then
Expand Down Expand Up @@ -235,9 +234,8 @@ private fun CoilRequestActor(
request: ImageRequest
) = RequestActor<IntSize, RequestResult?> { size ->
when {
request.sizeResolver !is DisplaySizeResolver -> {
// If the request doesn't have a default DisplaySizeResolver set, it must have a real
// size resolver, so we just execute the request as-is
request.defined.sizeResolver != null -> {
// If the request has a size resolver set we just execute the request as-is
request
}
size.width == UNSPECIFIED || size.height == UNSPECIFIED -> {
Expand Down

0 comments on commit c62c8c9

Please sign in to comment.