glide v4.10.0 Release Notes

Release Date: 2019-09-18 // 3 months ago
  • 🔋 Features

    • ➕ Added a Mocks library to mock GlideExecutor in unit/emulator tests (e021f6b)
    • ➕ Added an integration library to integrate with Guava's ListenableFuture class (9fb1036)
    • ➕ Add granular options for rounded corners (f36a9fa, thanks to dlos@)
    • Include day/night mode in resource id cache keys (1b391c4)
    • ➕ Add an API that can be called on Glide manually to clear memory, especially when apps are backgrounded (8a094e9, thanks to mikewallstedt@)
    • ➕ Add simple support for wide gamut color spaces (15a21b1, 7910f68)
    • 🚀 Release more memory in the background on M+ (525e7ba)
    • 👌 Support Fragments not hosted by Acitivities (71359c7, thanks to Daniel Tomasiewicz)
    • 🖐 Handle contexts with null application contexts (31b501d, thanks to Daniel Tomasiewicz)

    🐛 Bugs

    • 🛠 Fixed incorrect downsampling for rotated images when using Target.SIZE_ORIGINAL (79dac0d, thanks to sonyamollinger@)
    • 🛠 Fixed returning negative byte values converting ByteBuffers to InputStreams (24f9c28, thanks to sonyamollinger@)
    • 👉 Make sure to cancel all preload requests in cancelAll() (047c22d, thanks @paynemiller92)
    • 🛠 Fixed a series of concurrency bugs introduced by allowing requests to start on background threads (bee6348, 5cccdfb, 01ea6a5, b2a46ef, 6dc03d8, 4de2cda, b96b000, 8907122, 53438b9)
    • 👉 Make sure the specified numbers of threads are actually used in the animation executor (#3575, ac4aa53, thanks to @yuriy-budiyev)
    • Avoid blinking when calling RequestManager#pause when the thumbnail portion of a request is complete the full portion is still running (2f56153)
    • 👉 Make it less likely to mix support and non-support fragments (2193306, thanks to @limuyang2)
    • Avoid downsampling incorrectly in FitCenter and CenterInside when there was
      an exact power of 2 match in one dimension but not the other (3df5445)
    • Always use orientation corrected sizes in Downsampler (#3673, ebdf8be)
    • 🛠 Fix transparency in GifDecoder when using RGB_565 (29c553d, thanks to @lihongyu)
    • 🔒 Handle security exceptions trying to open MediaStore Uris when applications are given access to a MediaStore Uri via an Intent (#3504, 9c48b48)
    • 🛠 Fix an unused AnimationExecutor (7bb6f11, thanks to @phxnirvana)

    🗄 Deprecations

    • 🗄 Deprecate method to set custom tags in CustomViewTarget (c8d646e)

    Behavior Changes

    • Custom tags in CustomViewTarget are now ignored because they cause Glide to ignore calls to clear() (c8d646e)

    💥 Breaking Changes

    🏗 Build Changes


Previous changes from v4.9.0

  • 🔋 Features

    • 👍 Allow applying RequestOptions directly in a RequestBuilder without the generated API (ed20643)

    For example previously to apply centerCrop you'd have use a static method and apply():

    Glide.with(fragment) .load(url) .apply(centerCropTransform()) .into(imageView);
    

    Or use the generated API and the annotation processor:

    GlideApp.with(fragment) .load(url) .centerCrop() .into(imageView);
    

    After this change, even without the generated API/annotation processor you can access standard RequestOptions methods directly:

    Glide.with(fragment) .load(url) .centerCrop() .into(imageView);
    

    The generated API is still required for API extensions and to include integration libraries. Hopefully this makes it easier for users who do not include integration libraries and for developers of libraries that are currently unable to use the generated API to use Glide.

    • ➕ Add Global/Activity/Fragment scoped RequestListeners (37127f0)
    • ➕ Add a CustomTarget class to make it easier to reduce some non-essential boilerplate when implementing custom Targets. onLoadCleared still must be implemented by subclasses of CustomTarget (b3b2d7a)
    • 👌 Support loading resources from dynamic modules (#3308, b57ef34, thanks to @SUPERCILEX)
    • ➕ Add a varargs .transform() method to replace the equivalent .transforms() method (#2875, #3365, 8a26a6b, thanks to @aleien)
    • 👉 Make proguard rules consumable by users of the library (f7d8604, thanks to @rehlma)
    • 💻 Stop forcing all requests to be posted to the main thread to avoid unnecessary UI thread work and avoid delays caused by UI thread processing time for images loaded on background threads (8f1ea5c)
    • ➕ Add Animatable2Compat callbacks to GifDrawable so that users can be notified when a GIF animation with a non infinite loop count finishes (#3438, a150301, thanks to @AnwarShahriar)

    🐛 Bugs

    • 🛠 Fixed an issue where different types of requested resources (Bitmap vs Drawable etc) could share a cache key (cad83d2)
    • ↪ Work around an odd compiler bug creating new ArrayLists from other collections on some devices/versions of Android (#3296, 2ca790a)
    • ➕ Add Nullable/NonNull annotations to LazyHeaders.Builder (#3446, d6345fb, thanks to @r-ralph)
    • ➕ Add a transformation to rotate images (other than from EXIF) (1878585, thanks to @Gnzlt)
    • 🛠 Fix a race that could lead to doing useless work in MultiModelLoader after cancellation (3c9f92f)
    • 🛠 Fix a bug in SizeConfigStrategy that could lead to a returned Bitmap having an incorrect config (be51b4e)
    • Avoid classifying all images with non-0 exif orientations as having transparency to allow them to be cached as JPEGs instead of PNGs (e515f47)
    • ➕ Add a debug API that allows apps to attach a stack trace showing where a Glide request originated from. Note that this is fairly expensive and isn't meant to be used in production (114b885)
    • 🛠 Fix bugs handling resource Uris that point to resources in other applications (e2df4d0)

    🗄 Deprecations

    • 🗄 Deprecated .transforms(), it's replaced with the identical .transform() method (8a26a6b)

    Behavior Changes

    • RequestListeners for requests started on background threads can now be called on a background thread (8f1ea5c)

    💥 Breaking Changes

    • Subclasses of RequestBuilder/RequestOptions may be broken by ed20643. Typically the breakage is relatively simple to fix, but the exact methods that need to be called or that are exposed may have changed for subclasses.

    🏗 Build Changes