Coil v0.7.0 Release Notes

Release Date: 2019-09-08 // over 4 years ago
    • ๐Ÿ’ฅ Breaking: ImageLoaderBuilder.okHttpClient(OkHttpClient.Builder.() -> Unit) is now ImageLoaderBuilder.okHttpClient(() -> OkHttpClient). The initializer is also now called lazily on a background thread. If you set a custom OkHttpClient you must set OkHttpClient.cache to enable disk caching. If you don't set a custom OkHttpClient, Coil will create the default OkHttpClient which has disk caching enabled. The default Coil cache can be created using CoilUtils.createDefaultCache(context). e.g.:
    val imageLoader = ImageLoader(context) {
        okHttpClient {
            OkHttpClient.Builder()
                .cache(CoilUtils.createDefaultCache(context))
                .build()
        }
    }
    
    • ๐Ÿ’ฅ Breaking: Fetcher.key no longer has a default implementation.
    • ๐Ÿ’ฅ Breaking: Previously, only the first applicable Mapper would be called. Now, all applicable Mappers will be called. No API changes.
    • ๐Ÿ’ฅ Breaking: Minor named parameter renaming: url -> uri, factory -> initializer.

    • ๐Ÿ†• New: coil-svg artifact, which has an SvgDecoder that supports automatically decoding SVGs. Powered by AndroidSVG. Thanks @rharter.
    • ๐Ÿ†• New: load(String) and get(String) now accept any of the supported Uri schemes. e.g. You can now do imageView.load("file:///path/to/file.jpg").
    • ๐Ÿ†• New: Refactor ImageLoader to use Call.Factory instead of OkHttpClient. This allows lazy initialization of the networking resources using ImageLoaderBuilder.okHttpClient { OkHttpClient() }. Thanks @ZacSweers.
    • ๐Ÿ†• New: RequestBuilder.decoder to explicitly set the decoder for a request.
    • ๐Ÿ†• New: ImageLoaderBuilder.allowHardware to enable/disable hardware bitmaps by default for an ImageLoader.
    • ๐Ÿ†• New: Support software rendering in ImageDecoderDecoder.

    • ๐Ÿ›  Fix: Multiple bugs with loading vector drawables.
    • ๐Ÿ›  Fix: Support WRAP_CONTENT View dimensions.
    • ๐Ÿ›  Fix: Support parsing EXIF data longer than 8192 bytes.
    • ๐Ÿ›  Fix: Don't stretch drawables with different aspect ratios when crossfading.
    • ๐Ÿ›  Fix: Guard against network observer failing to register due to exception.
    • ๐Ÿ›  Fix: Fix divide by zero error in MovieDrawable. Thanks @R12rus.
    • ๐Ÿ›  Fix: Support nested Android asset files. Thanks @JaCzekanski.
    • ๐Ÿ›  Fix: Guard against running out of file descriptors on Android O and O_MR1.
    • ๐Ÿ›  Fix: Don't crash when disabling memory cache. Thanks @hansenji.
    • ๐Ÿ›  Fix: Ensure Target.cancel is always called from the main thread.

    • โšก๏ธ Update Kotlin to 1.3.50.
    • โšก๏ธ Update Kotlin Coroutines to 1.3.0.
    • โšก๏ธ Update OkHttp to 3.12.4.
    • โšก๏ธ Update Okio to 2.4.0.
    • โšก๏ธ Update AndroidX dependencies to the latest stable versions:
      • androidx.appcompat:appcompat -> 1.1.0
      • androidx.core:core-ktx -> 1.1.0
      • androidx.lifecycle:lifecycle-common-java8 -> 2.1.0
    • Replace appcompat with appcompat-resources as an optional compileOnly dependency. appcompat-resources is a much smaller artifact.