Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Coil 1.0.0-rc3 #95

Merged
merged 1 commit into from
Sep 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,6 @@ subprojects {
freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn"

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ object Libs {
const val appcompat = "androidx.appcompat:appcompat:1.3.0-alpha02"
}

const val coil = "io.coil-kt:coil:1.0.0-rc2"
const val coil = "io.coil-kt:coil:1.0.0-rc3"

const val truth = "com.google.truth:truth:1.0.1"
const val mockk = "io.mockk:mockk-android:1.10.0"
Expand Down
9 changes: 5 additions & 4 deletions coil/src/main/java/dev/chrisbanes/accompanist/coil/Coil.kt
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ import androidx.core.graphics.drawable.toBitmap
import coil.Coil
import coil.ImageLoader
import coil.decode.DataSource
import coil.imageLoader
import coil.request.ImageRequest
import coil.request.ImageResult

Expand Down Expand Up @@ -77,7 +78,7 @@ import coil.request.ImageResult
fun CoilImage(
data: Any,
modifier: Modifier = Modifier,
imageLoader: ImageLoader = Coil.imageLoader(ContextAmbient.current),
imageLoader: ImageLoader = ContextAmbient.current.imageLoader,
shouldRefetchOnSizeChange: (currentResult: CoilImageState, size: IntSize) -> Boolean = defaultRefetchOnSizeChangeLambda,
onRequestCompleted: (CoilImageState) -> Unit = emptySuccessLambda,
content: @Composable (imageState: CoilImageState) -> Unit
Expand Down Expand Up @@ -123,7 +124,7 @@ fun CoilImage(
fun CoilImage(
request: ImageRequest,
modifier: Modifier = Modifier,
imageLoader: ImageLoader = Coil.imageLoader(ContextAmbient.current),
imageLoader: ImageLoader = ContextAmbient.current.imageLoader,
shouldRefetchOnSizeChange: (currentResult: CoilImageState, size: IntSize) -> Boolean = defaultRefetchOnSizeChangeLambda,
onRequestCompleted: (CoilImageState) -> Unit = emptySuccessLambda,
content: @Composable (imageState: CoilImageState) -> Unit
Expand Down Expand Up @@ -231,7 +232,7 @@ fun CoilImage(
contentScale: ContentScale = ContentScale.Fit,
colorFilter: ColorFilter? = null,
fadeIn: Boolean = false,
imageLoader: ImageLoader = Coil.imageLoader(ContextAmbient.current),
imageLoader: ImageLoader = ContextAmbient.current.imageLoader,
shouldRefetchOnSizeChange: (currentResult: CoilImageState, size: IntSize) -> Boolean = defaultRefetchOnSizeChangeLambda,
onRequestCompleted: (CoilImageState) -> Unit = emptySuccessLambda,
error: @Composable ((CoilImageState.Error) -> Unit)? = null,
Expand Down Expand Up @@ -301,7 +302,7 @@ fun CoilImage(
contentScale: ContentScale = ContentScale.Fit,
colorFilter: ColorFilter? = null,
fadeIn: Boolean = false,
imageLoader: ImageLoader = Coil.imageLoader(ContextAmbient.current),
imageLoader: ImageLoader = ContextAmbient.current.imageLoader,
shouldRefetchOnSizeChange: (currentResult: CoilImageState, size: IntSize) -> Boolean = defaultRefetchOnSizeChangeLambda,
onRequestCompleted: (CoilImageState) -> Unit = emptySuccessLambda,
error: @Composable ((CoilImageState.Error) -> Unit)? = null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ import androidx.compose.ui.unit.IntOffset
import androidx.compose.ui.unit.IntSize
import androidx.compose.ui.unit.toSize
import androidx.core.util.Pools
import coil.Coil
import coil.ImageLoader
import coil.decode.DataSource
import coil.imageLoader
import coil.request.ImageRequest

private const val DefaultTransitionDuration = 1000
Expand Down Expand Up @@ -87,7 +87,7 @@ fun CoilImageWithCrossfade(
alignment: Alignment = Alignment.Center,
contentScale: ContentScale = ContentScale.Fit,
crossfadeDuration: Int = DefaultTransitionDuration,
imageLoader: ImageLoader = Coil.imageLoader(ContextAmbient.current),
imageLoader: ImageLoader = ContextAmbient.current.imageLoader,
shouldRefetchOnSizeChange: (currentResult: CoilImageState, size: IntSize) -> Boolean = defaultRefetchOnSizeChangeLambda,
onRequestCompleted: (CoilImageState) -> Unit = emptySuccessLambda,
error: @Composable ((CoilImageState.Error) -> Unit)? = null,
Expand Down Expand Up @@ -138,7 +138,7 @@ fun CoilImageWithCrossfade(
alignment: Alignment = Alignment.Center,
contentScale: ContentScale = ContentScale.Fit,
crossfadeDuration: Int = DefaultTransitionDuration,
imageLoader: ImageLoader = Coil.imageLoader(ContextAmbient.current),
imageLoader: ImageLoader = ContextAmbient.current.imageLoader,
shouldRefetchOnSizeChange: (currentResult: CoilImageState, size: IntSize) -> Boolean = defaultRefetchOnSizeChangeLambda,
onRequestCompleted: (CoilImageState) -> Unit = emptySuccessLambda,
error: @Composable ((CoilImageState.Error) -> Unit)? = null,
Expand Down