coil-kt/coil (io.coil-kt:coil-compose)
### [`v2.7.0`](https://togithub.com/coil-kt/coil/blob/HEAD/CHANGELOG.md#270---July-17-2024)
[Compare Source](https://togithub.com/coil-kt/coil/compare/2.6.0...2.7.0)
- Slightly optimize internal coroutines usage to improve the performance of `ImageLoader.execute`, `AsyncImage`, `SubcomposeAsyncImage`, and `rememberAsyncImagePainter`. ([#2205](https://togithub.com/coil-kt/coil/pull/2205))
- Fix duplicate network calls for chunked responses. ([#2363](https://togithub.com/coil-kt/coil/pull/2363))
- Update Kotlin to 2.0.0.
- Update Compose UI to 1.6.8.
- Update Okio to 3.9.0.
### [`v2.6.0`](https://togithub.com/coil-kt/coil/blob/HEAD/CHANGELOG.md#260---February-23-2024)
[Compare Source](https://togithub.com/coil-kt/coil/compare/2.5.0...2.6.0)
- Make `rememberAsyncImagePainter`, `AsyncImage`, and `SubcomposeAsyncImage` [restartable and skippable](https://developer.android.com/jetpack/compose/performance/stability#functions). This improves performance by avoiding recomposition unless one of the composable's arguments changes.
- Add an optional `modelEqualityDelegate` argument to `rememberAsyncImagePainter`, `AsyncImage`, and `SubcomposeAsyncImage` to control whether the `model` will trigger a recomposition.
- Update `ContentPainterModifier` to implement `Modifier.Node`.
- Fix: Lazily register component callbacks and the network observer on a background thread. This fixes slow initialization that would often occur on the main thread.
- Fix: Avoid relaunching a new image request in `rememberAsyncImagePainter`, `AsyncImage`, and `SubcomposeAsyncImage` if `ImageRequest.listener` or `ImageRequest.target` change.
- Fix: Don't observe the image request twice in `AsyncImagePainter`.
- Update Kotlin to 1.9.22.
- Update Compose to 1.6.1.
- Update Okio to 3.8.0.
- Update `androidx.collection` to 1.4.0.
- Update `androidx.lifecycle` to 2.7.0.
### [`v2.5.0`](https://togithub.com/coil-kt/coil/blob/HEAD/CHANGELOG.md#250---October-30-2023)
[Compare Source](https://togithub.com/coil-kt/coil/compare/2.4.0...2.5.0)
- **New**: Add `MediaDataSourceFetcher.Factory` to support decoding `MediaDataSource` implementations in `coil-video`. ([#1795](https://togithub.com/coil-kt/coil/pull/1795))
- Add the `SHIFT6m` device to the hardware bitmap blocklist. ([#1812](https://togithub.com/coil-kt/coil/pull/1812))
- Fix: Guard against painters that return a size with one unbounded dimension. ([#1826](https://togithub.com/coil-kt/coil/pull/1826))
- Fix: Disk cache load fails after `304 Not Modified` when cached headers include non-ASCII characters. ([#1839](https://togithub.com/coil-kt/coil/pull/1839))
- Fix: `FakeImageEngine` not updating the interceptor chain's request. ([#1905](https://togithub.com/coil-kt/coil/pull/1905))
- Update compile SDK to 34.
- Update Kotlin to 1.9.10.
- Update Coroutines to 1.7.3.
- Update `accompanist-drawablepainter` to 0.32.0.
- Update `androidx.annotation` to 1.7.0.
- Update `androidx.compose.foundation` to 1.5.4.
- Update `androidx.core` to 1.12.0.
- Update `androidx.exifinterface:exifinterface` to 1.3.6.
- Update `androidx.lifecycle` to 2.6.2.
- Update `com.squareup.okhttp3` to 4.12.0.
- Update `com.squareup.okio` to 3.6.0.
### [`v2.4.0`](https://togithub.com/coil-kt/coil/blob/HEAD/CHANGELOG.md#240---May-21-2023)
[Compare Source](https://togithub.com/coil-kt/coil/compare/2.3.0...2.4.0)
- Rename `DiskCache` `get`/`edit` to `openSnapshot`/`openEditor`.
- Don't automatically convert `ColorDrawable` to `ColorPainter` in `AsyncImagePainter`.
- Annotate simple `AsyncImage` overloads with `@NonRestartableComposable`.
- Fix: Call `Context.cacheDir` lazily in `ImageSource`.
- Fix: Fix publishing `coil-bom`.
- Fix: Fix always setting bitmap config to `ARGB_8888` if hardware bitmaps are disabled.
- Update Kotlin to 1.8.21.
- Update Coroutines to 1.7.1.
- Update `accompanist-drawablepainter` to 0.30.1.
- Update `androidx.compose.foundation` to 1.4.3.
- Update `androidx.profileinstaller:profileinstaller` to 1.3.1.
- Update `com.squareup.okhttp3` to 4.11.0.
### [`v2.3.0`](https://togithub.com/coil-kt/coil/blob/HEAD/CHANGELOG.md#230---March-25-2023)
[Compare Source](https://togithub.com/coil-kt/coil/compare/2.2.2...2.3.0)
- **New**: Introduce a new `coil-test` artifact, which includes `FakeImageLoaderEngine`. This class is useful for hardcoding image loader responses to ensure consistent and synchronous (from the main thread) responses in tests. See [here](https://coil-kt.github.io/coil/testing) for more info.
- **New**: Add [baseline profiles](https://developer.android.com/topic/performance/baselineprofiles/overview) to `coil-base` (child module of `coil`) and `coil-compose-base` (child module of `coil-compose`).
- This improves Coil's runtime performance and should offer [better frame timings](https://togithub.com/coil-kt/coil/tree/main/coil-benchmark/benchmark_output.md) depending on how Coil is used in your app.
- Fix: Fix parsing `file://` URIs with encoded data. [#1601](https://togithub.com/coil-kt/coil/pull/1601)
- Fix: `DiskCache` now properly computes its maximum size if passed a directory that does not exist. [#1620](https://togithub.com/coil-kt/coil/pull/1620)
- Make `Coil.reset` public API. [#1506](https://togithub.com/coil-kt/coil/pull/1506)
- Enable Java default method generation. [#1491](https://togithub.com/coil-kt/coil/pull/1491)
- Update Kotlin to 1.8.10.
- Update `accompanist-drawablepainter` to 0.30.0.
- Update `androidx.annotation` to 1.6.0.
- Update `androidx.appcompat:appcompat-resources` to 1.6.1.
- Update `androidx.compose.foundation` to 1.4.0.
- Update `androidx.core` to 1.9.0.
- Update `androidx.exifinterface:exifinterface` to 1.3.6.
- Update `androidx.lifecycle` to 2.6.1.
- Update `okio` to 3.3.0.
### [`v2.2.2`](https://togithub.com/coil-kt/coil/blob/HEAD/CHANGELOG.md#222---October-1-2022)
[Compare Source](https://togithub.com/coil-kt/coil/compare/2.2.1...2.2.2)
- Ensure an image loader is fully initialized before registering its system callbacks. [#1465](https://togithub.com/coil-kt/coil/pull/1465)
- Set the preferred bitmap config in `VideoFrameDecoder` on API 30+ to avoid banding. [#1487](https://togithub.com/coil-kt/coil/pull/1487)
- Fix parsing paths containing `#` in `FileUriMapper`. [#1466](https://togithub.com/coil-kt/coil/pull/1466)
- Fix reading responses with non-ascii headers from the disk cache. [#1468](https://togithub.com/coil-kt/coil/pull/1468)
- Fix decoding videos inside asset subfolders. [#1489](https://togithub.com/coil-kt/coil/pull/1489)
- Update `androidx.annotation` to 1.5.0.
### [`v2.2.1`](https://togithub.com/coil-kt/coil/blob/HEAD/CHANGELOG.md#221---September-8-2022)
[Compare Source](https://togithub.com/coil-kt/coil/compare/2.2.0...2.2.1)
- Fix: `RoundedCornersTransformation` now properly scales the `input` bitmap.
- Remove dependency on the `kotlin-parcelize` plugin.
- Update compile SDK to 33.
- Downgrade `androidx.appcompat:appcompat-resources` to 1.4.2 to work around [#1423](https://togithub.com/coil-kt/coil/issues/1423).
### [`v2.2.0`](https://togithub.com/coil-kt/coil/blob/HEAD/CHANGELOG.md#220---August-16-2022)
[Compare Source](https://togithub.com/coil-kt/coil/compare/2.1.0...2.2.0)
- **New**: Add `ImageRequest.videoFramePercent` to `coil-video` to support specifying the video frame as a percent of the video's duration.
- **New**: Add `ExifOrientationPolicy` to configure how `BitmapFactoryDecoder` treats EXIF orientation data.
- Fix: Don't throw an exception in `RoundedCornersTransformation` if passed a size with an undefined dimension.
- Fix: Read a GIF's frame delay as two unsigned bytes instead of one signed byte.
- Update Kotlin to 1.7.10.
- Update Coroutines to 1.6.4.
- Update Compose to 1.2.1.
- Update OkHttp to 4.10.0.
- Update Okio to 3.2.0.
- Update `accompanist-drawablepainter` to 0.25.1.
- Update `androidx.annotation` to 1.4.0.
- Update `androidx.appcompat:appcompat-resources` to 1.5.0.
- Update `androidx.core` to 1.8.0.
### [`v2.1.0`](https://togithub.com/coil-kt/coil/blob/HEAD/CHANGELOG.md#210---May-17-2022)
[Compare Source](https://togithub.com/coil-kt/coil/compare/2.0.0...2.1.0)
- **New**: Support loading `ByteArray`s. ([#1202](https://togithub.com/coil-kt/coil/pull/1202))
- **New**: Support setting custom CSS rules for SVGs using `ImageRequest.Builder.css`. ([#1210](https://togithub.com/coil-kt/coil/pull/1210))
- Fix: Convert `GenericViewTarget`'s private methods to protected. ([#1273](https://togithub.com/coil-kt/coil/pull/1273))
- Update compile SDK to 32. ([#1268](https://togithub.com/coil-kt/coil/pull/1268))
### [`v2.0.0`](https://togithub.com/coil-kt/coil/blob/HEAD/CHANGELOG.md#200---May-10-2022)
[Compare Source](https://togithub.com/coil-kt/coil/compare/1.4.0...2.0.0)
Coil 2.0.0 is a major iteration of the library and includes breaking changes. Check out the [upgrade guide](https://coil-kt.github.io/coil/upgrading/) for how to upgrade.
- **New**: Introduce `AsyncImage` in `coil-compose`. Check out [the documentation](https://coil-kt.github.io/coil/compose/) for more info.
```kotlin
// Display an image from the network.
AsyncImage(
model = "https://example.com/image.jpg",
contentDescription = null,
)
// Display an image from the network with a placeholder, circle crop, and crossfade animation.
AsyncImage(
model = ImageRequest.Builder(LocalContext.current)
.data("https://example.com/image.jpg")
.crossfade(true)
.build(),
placeholder = painterResource(R.drawable.placeholder),
contentDescription = stringResource(R.string.description),
contentScale = ContentScale.Crop,
modifier = Modifier.clip(CircleShape)
)
```
- **New**: Introduce a public `DiskCache` API.
- Use `ImageLoader.Builder.diskCache` and `DiskCache.Builder` to configure the disk cache.
- You should not use OkHttp's `Cache` with Coil 2.0. See [here](https://coil-kt.github.io/coil/upgrading_to_coil2/#disk-cache) for more info.
- `Cache-Control` and other cache headers are still supported - except `Vary` headers, as the cache only checks that the URLs match. Additionally, only responses with a response code in the range \[200..300) are cached.
- Existing disk caches will be cleared when upgrading to 2.0.
- The minimum supported API is now 21.
- `ImageRequest`'s default `Scale` is now `Scale.FIT`.
- This was changed to make `ImageRequest.scale` consistent with other classes that have a default `Scale`.
- Requests with an `ImageViewTarget` still have their `Scale` auto-detected.
- Rework the image pipeline classes:
- `Mapper`, `Fetcher`, and `Decoder` have been refactored to be more flexible.
- `Fetcher.key` has been replaced with a new `Keyer` interface. `Keyer` creates the cache key from the input data.
- Add `ImageSource`, which allows `Decoder`s to read `File`s directly using Okio's file system API.
- Rework the Jetpack Compose integration:
- `rememberImagePainter` and `ImagePainter` have been renamed to `rememberAsyncImagePainter` and `AsyncImagePainter` respectively.
- Deprecate `LocalImageLoader`. Check out the deprecation message for more info.
- Disable generating runtime not-null assertions.
- If you use Java, passing null as a not-null annotated argument to a function will no longer throw a `NullPointerException` immediately. Kotlin's compile-time null safety guards against this happening.
- This change allows the library's size to be smaller.
- `Size` is now composed of two `Dimension` values for its width and height. `Dimension` can either be a positive pixel value or `Dimension.Undefined`. See [here](https://coil-kt.github.io/coil/upgrading/#size-refactor) for more info.
- `BitmapPool` and `PoolableViewTarget` have been removed from the library.
- `VideoFrameFileFetcher` and `VideoFrameUriFetcher` have been removed from the library. Use `VideoFrameDecoder` instead, which supports all data sources.
- [`BlurTransformation`](https://togithub.com/coil-kt/coil/blob/845f39383f332428077c666e3567b954675ce248/coil-core/src/main/java/coil/transform/BlurTransformation.kt) and [`GrayscaleTransformation`](https://togithub.com/coil-kt/coil/blob/845f39383f332428077c666e3567b954675ce248/coil-core/src/main/java/coil/transform/GrayscaleTransformation.kt) are removed from the library. If you use them, you can copy their code into your project.
- Change `Transition.transition` to be a non-suspending function as it's no longer needed to suspend the transition until it completes.
- Add support for `bitmapFactoryMaxParallelism`, which restricts the maximum number of in-progress `BitmapFactory` operations. This value is 4 by default, which improves UI performance.
- Add support for `interceptorDispatcher`, `fetcherDispatcher`, `decoderDispatcher`, and `transformationDispatcher`.
- Add `GenericViewTarget`, which handles common `ViewTarget` logic.
- Add `ByteBuffer` to the default supported data types.
- `Disposable` has been refactored and exposes the underlying `ImageRequest`'s job.
- Rework the `MemoryCache` API.
- `ImageRequest.error` is now set on the `Target` if `ImageRequest.fallback` is null.
- `Transformation.key` is replaced with `Transformation.cacheKey`.
- Update Kotlin to 1.6.10.
- Update Compose to 1.1.1.
- Update OkHttp to 4.9.3.
- Update Okio to 3.0.0.
Changes from `2.0.0-rc03`:
- Convert `Dimension.Original` to be `Dimension.Undefined`.
- This changes the semantics of the non-pixel dimension slightly to fix some edge cases ([example](https://togithub.com/coil-kt/coil/issues/1246)) in the size system.
- Load images with `Size.ORIGINAL` if ContentScale is None.
- Fix applying `ImageView.load` builder argument first instead of last.
- Fix not combining HTTP headers if response is not modified.
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
[ ] If you want to rebase/retry this PR, check this box
This PR contains the following updates:
1.4.0
->2.7.0
Release Notes
coil-kt/coil (io.coil-kt:coil-compose)
### [`v2.7.0`](https://togithub.com/coil-kt/coil/blob/HEAD/CHANGELOG.md#270---July-17-2024) [Compare Source](https://togithub.com/coil-kt/coil/compare/2.6.0...2.7.0) - Slightly optimize internal coroutines usage to improve the performance of `ImageLoader.execute`, `AsyncImage`, `SubcomposeAsyncImage`, and `rememberAsyncImagePainter`. ([#2205](https://togithub.com/coil-kt/coil/pull/2205)) - Fix duplicate network calls for chunked responses. ([#2363](https://togithub.com/coil-kt/coil/pull/2363)) - Update Kotlin to 2.0.0. - Update Compose UI to 1.6.8. - Update Okio to 3.9.0. ### [`v2.6.0`](https://togithub.com/coil-kt/coil/blob/HEAD/CHANGELOG.md#260---February-23-2024) [Compare Source](https://togithub.com/coil-kt/coil/compare/2.5.0...2.6.0) - Make `rememberAsyncImagePainter`, `AsyncImage`, and `SubcomposeAsyncImage` [restartable and skippable](https://developer.android.com/jetpack/compose/performance/stability#functions). This improves performance by avoiding recomposition unless one of the composable's arguments changes. - Add an optional `modelEqualityDelegate` argument to `rememberAsyncImagePainter`, `AsyncImage`, and `SubcomposeAsyncImage` to control whether the `model` will trigger a recomposition. - Update `ContentPainterModifier` to implement `Modifier.Node`. - Fix: Lazily register component callbacks and the network observer on a background thread. This fixes slow initialization that would often occur on the main thread. - Fix: Avoid relaunching a new image request in `rememberAsyncImagePainter`, `AsyncImage`, and `SubcomposeAsyncImage` if `ImageRequest.listener` or `ImageRequest.target` change. - Fix: Don't observe the image request twice in `AsyncImagePainter`. - Update Kotlin to 1.9.22. - Update Compose to 1.6.1. - Update Okio to 3.8.0. - Update `androidx.collection` to 1.4.0. - Update `androidx.lifecycle` to 2.7.0. ### [`v2.5.0`](https://togithub.com/coil-kt/coil/blob/HEAD/CHANGELOG.md#250---October-30-2023) [Compare Source](https://togithub.com/coil-kt/coil/compare/2.4.0...2.5.0) - **New**: Add `MediaDataSourceFetcher.Factory` to support decoding `MediaDataSource` implementations in `coil-video`. ([#1795](https://togithub.com/coil-kt/coil/pull/1795)) - Add the `SHIFT6m` device to the hardware bitmap blocklist. ([#1812](https://togithub.com/coil-kt/coil/pull/1812)) - Fix: Guard against painters that return a size with one unbounded dimension. ([#1826](https://togithub.com/coil-kt/coil/pull/1826)) - Fix: Disk cache load fails after `304 Not Modified` when cached headers include non-ASCII characters. ([#1839](https://togithub.com/coil-kt/coil/pull/1839)) - Fix: `FakeImageEngine` not updating the interceptor chain's request. ([#1905](https://togithub.com/coil-kt/coil/pull/1905)) - Update compile SDK to 34. - Update Kotlin to 1.9.10. - Update Coroutines to 1.7.3. - Update `accompanist-drawablepainter` to 0.32.0. - Update `androidx.annotation` to 1.7.0. - Update `androidx.compose.foundation` to 1.5.4. - Update `androidx.core` to 1.12.0. - Update `androidx.exifinterface:exifinterface` to 1.3.6. - Update `androidx.lifecycle` to 2.6.2. - Update `com.squareup.okhttp3` to 4.12.0. - Update `com.squareup.okio` to 3.6.0. ### [`v2.4.0`](https://togithub.com/coil-kt/coil/blob/HEAD/CHANGELOG.md#240---May-21-2023) [Compare Source](https://togithub.com/coil-kt/coil/compare/2.3.0...2.4.0) - Rename `DiskCache` `get`/`edit` to `openSnapshot`/`openEditor`. - Don't automatically convert `ColorDrawable` to `ColorPainter` in `AsyncImagePainter`. - Annotate simple `AsyncImage` overloads with `@NonRestartableComposable`. - Fix: Call `Context.cacheDir` lazily in `ImageSource`. - Fix: Fix publishing `coil-bom`. - Fix: Fix always setting bitmap config to `ARGB_8888` if hardware bitmaps are disabled. - Update Kotlin to 1.8.21. - Update Coroutines to 1.7.1. - Update `accompanist-drawablepainter` to 0.30.1. - Update `androidx.compose.foundation` to 1.4.3. - Update `androidx.profileinstaller:profileinstaller` to 1.3.1. - Update `com.squareup.okhttp3` to 4.11.0. ### [`v2.3.0`](https://togithub.com/coil-kt/coil/blob/HEAD/CHANGELOG.md#230---March-25-2023) [Compare Source](https://togithub.com/coil-kt/coil/compare/2.2.2...2.3.0) - **New**: Introduce a new `coil-test` artifact, which includes `FakeImageLoaderEngine`. This class is useful for hardcoding image loader responses to ensure consistent and synchronous (from the main thread) responses in tests. See [here](https://coil-kt.github.io/coil/testing) for more info. - **New**: Add [baseline profiles](https://developer.android.com/topic/performance/baselineprofiles/overview) to `coil-base` (child module of `coil`) and `coil-compose-base` (child module of `coil-compose`). - This improves Coil's runtime performance and should offer [better frame timings](https://togithub.com/coil-kt/coil/tree/main/coil-benchmark/benchmark_output.md) depending on how Coil is used in your app. - Fix: Fix parsing `file://` URIs with encoded data. [#1601](https://togithub.com/coil-kt/coil/pull/1601) - Fix: `DiskCache` now properly computes its maximum size if passed a directory that does not exist. [#1620](https://togithub.com/coil-kt/coil/pull/1620) - Make `Coil.reset` public API. [#1506](https://togithub.com/coil-kt/coil/pull/1506) - Enable Java default method generation. [#1491](https://togithub.com/coil-kt/coil/pull/1491) - Update Kotlin to 1.8.10. - Update `accompanist-drawablepainter` to 0.30.0. - Update `androidx.annotation` to 1.6.0. - Update `androidx.appcompat:appcompat-resources` to 1.6.1. - Update `androidx.compose.foundation` to 1.4.0. - Update `androidx.core` to 1.9.0. - Update `androidx.exifinterface:exifinterface` to 1.3.6. - Update `androidx.lifecycle` to 2.6.1. - Update `okio` to 3.3.0. ### [`v2.2.2`](https://togithub.com/coil-kt/coil/blob/HEAD/CHANGELOG.md#222---October-1-2022) [Compare Source](https://togithub.com/coil-kt/coil/compare/2.2.1...2.2.2) - Ensure an image loader is fully initialized before registering its system callbacks. [#1465](https://togithub.com/coil-kt/coil/pull/1465) - Set the preferred bitmap config in `VideoFrameDecoder` on API 30+ to avoid banding. [#1487](https://togithub.com/coil-kt/coil/pull/1487) - Fix parsing paths containing `#` in `FileUriMapper`. [#1466](https://togithub.com/coil-kt/coil/pull/1466) - Fix reading responses with non-ascii headers from the disk cache. [#1468](https://togithub.com/coil-kt/coil/pull/1468) - Fix decoding videos inside asset subfolders. [#1489](https://togithub.com/coil-kt/coil/pull/1489) - Update `androidx.annotation` to 1.5.0. ### [`v2.2.1`](https://togithub.com/coil-kt/coil/blob/HEAD/CHANGELOG.md#221---September-8-2022) [Compare Source](https://togithub.com/coil-kt/coil/compare/2.2.0...2.2.1) - Fix: `RoundedCornersTransformation` now properly scales the `input` bitmap. - Remove dependency on the `kotlin-parcelize` plugin. - Update compile SDK to 33. - Downgrade `androidx.appcompat:appcompat-resources` to 1.4.2 to work around [#1423](https://togithub.com/coil-kt/coil/issues/1423). ### [`v2.2.0`](https://togithub.com/coil-kt/coil/blob/HEAD/CHANGELOG.md#220---August-16-2022) [Compare Source](https://togithub.com/coil-kt/coil/compare/2.1.0...2.2.0) - **New**: Add `ImageRequest.videoFramePercent` to `coil-video` to support specifying the video frame as a percent of the video's duration. - **New**: Add `ExifOrientationPolicy` to configure how `BitmapFactoryDecoder` treats EXIF orientation data. - Fix: Don't throw an exception in `RoundedCornersTransformation` if passed a size with an undefined dimension. - Fix: Read a GIF's frame delay as two unsigned bytes instead of one signed byte. - Update Kotlin to 1.7.10. - Update Coroutines to 1.6.4. - Update Compose to 1.2.1. - Update OkHttp to 4.10.0. - Update Okio to 3.2.0. - Update `accompanist-drawablepainter` to 0.25.1. - Update `androidx.annotation` to 1.4.0. - Update `androidx.appcompat:appcompat-resources` to 1.5.0. - Update `androidx.core` to 1.8.0. ### [`v2.1.0`](https://togithub.com/coil-kt/coil/blob/HEAD/CHANGELOG.md#210---May-17-2022) [Compare Source](https://togithub.com/coil-kt/coil/compare/2.0.0...2.1.0) - **New**: Support loading `ByteArray`s. ([#1202](https://togithub.com/coil-kt/coil/pull/1202)) - **New**: Support setting custom CSS rules for SVGs using `ImageRequest.Builder.css`. ([#1210](https://togithub.com/coil-kt/coil/pull/1210)) - Fix: Convert `GenericViewTarget`'s private methods to protected. ([#1273](https://togithub.com/coil-kt/coil/pull/1273)) - Update compile SDK to 32. ([#1268](https://togithub.com/coil-kt/coil/pull/1268)) ### [`v2.0.0`](https://togithub.com/coil-kt/coil/blob/HEAD/CHANGELOG.md#200---May-10-2022) [Compare Source](https://togithub.com/coil-kt/coil/compare/1.4.0...2.0.0) Coil 2.0.0 is a major iteration of the library and includes breaking changes. Check out the [upgrade guide](https://coil-kt.github.io/coil/upgrading/) for how to upgrade. - **New**: Introduce `AsyncImage` in `coil-compose`. Check out [the documentation](https://coil-kt.github.io/coil/compose/) for more info. ```kotlin // Display an image from the network. AsyncImage( model = "https://example.com/image.jpg", contentDescription = null, ) // Display an image from the network with a placeholder, circle crop, and crossfade animation. AsyncImage( model = ImageRequest.Builder(LocalContext.current) .data("https://example.com/image.jpg") .crossfade(true) .build(), placeholder = painterResource(R.drawable.placeholder), contentDescription = stringResource(R.string.description), contentScale = ContentScale.Crop, modifier = Modifier.clip(CircleShape) ) ``` - **New**: Introduce a public `DiskCache` API. - Use `ImageLoader.Builder.diskCache` and `DiskCache.Builder` to configure the disk cache. - You should not use OkHttp's `Cache` with Coil 2.0. See [here](https://coil-kt.github.io/coil/upgrading_to_coil2/#disk-cache) for more info. - `Cache-Control` and other cache headers are still supported - except `Vary` headers, as the cache only checks that the URLs match. Additionally, only responses with a response code in the range \[200..300) are cached. - Existing disk caches will be cleared when upgrading to 2.0. - The minimum supported API is now 21. - `ImageRequest`'s default `Scale` is now `Scale.FIT`. - This was changed to make `ImageRequest.scale` consistent with other classes that have a default `Scale`. - Requests with an `ImageViewTarget` still have their `Scale` auto-detected. - Rework the image pipeline classes: - `Mapper`, `Fetcher`, and `Decoder` have been refactored to be more flexible. - `Fetcher.key` has been replaced with a new `Keyer` interface. `Keyer` creates the cache key from the input data. - Add `ImageSource`, which allows `Decoder`s to read `File`s directly using Okio's file system API. - Rework the Jetpack Compose integration: - `rememberImagePainter` and `ImagePainter` have been renamed to `rememberAsyncImagePainter` and `AsyncImagePainter` respectively. - Deprecate `LocalImageLoader`. Check out the deprecation message for more info. - Disable generating runtime not-null assertions. - If you use Java, passing null as a not-null annotated argument to a function will no longer throw a `NullPointerException` immediately. Kotlin's compile-time null safety guards against this happening. - This change allows the library's size to be smaller. - `Size` is now composed of two `Dimension` values for its width and height. `Dimension` can either be a positive pixel value or `Dimension.Undefined`. See [here](https://coil-kt.github.io/coil/upgrading/#size-refactor) for more info. - `BitmapPool` and `PoolableViewTarget` have been removed from the library. - `VideoFrameFileFetcher` and `VideoFrameUriFetcher` have been removed from the library. Use `VideoFrameDecoder` instead, which supports all data sources. - [`BlurTransformation`](https://togithub.com/coil-kt/coil/blob/845f39383f332428077c666e3567b954675ce248/coil-core/src/main/java/coil/transform/BlurTransformation.kt) and [`GrayscaleTransformation`](https://togithub.com/coil-kt/coil/blob/845f39383f332428077c666e3567b954675ce248/coil-core/src/main/java/coil/transform/GrayscaleTransformation.kt) are removed from the library. If you use them, you can copy their code into your project. - Change `Transition.transition` to be a non-suspending function as it's no longer needed to suspend the transition until it completes. - Add support for `bitmapFactoryMaxParallelism`, which restricts the maximum number of in-progress `BitmapFactory` operations. This value is 4 by default, which improves UI performance. - Add support for `interceptorDispatcher`, `fetcherDispatcher`, `decoderDispatcher`, and `transformationDispatcher`. - Add `GenericViewTarget`, which handles common `ViewTarget` logic. - Add `ByteBuffer` to the default supported data types. - `Disposable` has been refactored and exposes the underlying `ImageRequest`'s job. - Rework the `MemoryCache` API. - `ImageRequest.error` is now set on the `Target` if `ImageRequest.fallback` is null. - `Transformation.key` is replaced with `Transformation.cacheKey`. - Update Kotlin to 1.6.10. - Update Compose to 1.1.1. - Update OkHttp to 4.9.3. - Update Okio to 3.0.0. Changes from `2.0.0-rc03`: - Convert `Dimension.Original` to be `Dimension.Undefined`. - This changes the semantics of the non-pixel dimension slightly to fix some edge cases ([example](https://togithub.com/coil-kt/coil/issues/1246)) in the size system. - Load images with `Size.ORIGINAL` if ContentScale is None. - Fix applying `ImageView.load` builder argument first instead of last. - Fix not combining HTTP headers if response is not modified.Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.