Glide 4.5.0
This is the December release of Glide.
Features
- Add an API to pause all requests for a given
Activity
orFragment
to allow callers to manually reduce memory when their Fragment or Application is backgrounded (@kurtisnelson, 09e33a2) - Fully support Bitmap re-use for
RGBA_F16
Bitmap
s. Previously Glide supported decodingRGBA_F16
Bitmap
s, but would not re-use any stored in theBitmapPool
when doing so (cc0288c) - Support decoding Videos from resources as
AssetFileDescriptor
s (6e9866b) - Added support for the
MediaMetadataRetriever#getScaledFrameAtTime
method added in OMR1 to marginally reduce memory usage when decoding video frames (ded8f77) - Support transcoding
BitmapDrawable
s tobyte[]
s (015d265)
Bugs
- Cleaned up old and incorrect
@TargetApi
annoatations (@SUPERCILEX, 6778396) - Added
@Nullable
and@NonNull
annotations to many of Glide's APIs (@SUPERCILEX, dc12b60, c3dafde, 0cffd1d, f541b65, 36e0b80, 650bb77, bd2f215, e35a73b, f37ced1, bb96b63, 276d4ff, c310780, ) - Fixed a case where restarting an identical request with
skipMemoryCache(true)
would complete the load from the memory cache (#2663, 3dc1d18) - Fixed decoding interlaced and downsampled GIFs as static images (#2698, b64f23d)
- Added more models to the list of devices requiring a lock when decoding or drawing Bitmaps (@strooooke, #738, c809f7e, e923554)
- Fixed a race condition where starting multiple loads simultaneously the first time any request is made for a given model and resource could lead to NPEs (#2708, d427cbd)
- Make the annotation processor tests pass on Windows (@SUPERCILEX, #2709, 2b4be8b)
- Fix NPE and RuntimeExceptions thrown in
DefaultConnectivityMonitor
on some devices (c902730) - Only trim to half of the memory cache maximum size, not the current size, when background the app (@kurtisnelson, 429b7e2)
- Fix a
StateVerifier
exception thrown whenResourceEncoder
implementations unexpectedly throw exceptions while writing resources to Glide's disk cache (6c7cf3f) - Fix an NPE error message when
ResourceDrawableDecoder
fails to decode an image (d522ac7) - Fix an
IllegalStateException
if a request using.error()
is cleared while the error request is running (#2767, 9c70aa5) - Cleaned up a number of accessor classes generated by unnecessarily strict visibility in inner classes (@TWiStErRob, e029694)
- Updated OkHttp and removed a no longer necessary workaround for
ClassCastException
s thrown by the Android framework on O (#2355, 642b2dc) - Added missing annotations to overrides on some of Glide's generated classes (@TWiStErRob, 62d7464, 9fde006, d7bb6f9)
- Avoid throwing exceptions when
LruBitmapPool
was asked to provideBitmap
s with anull
config (c1036c1)
Behavior Changes
- Default to
aar
packaging in POMs, so@aar
should no longer be required to avoid warnings about jars depending on aars (06ba344) - Default active resource retention to false (73759b9), but leave the option in
GlideBuilder
to manually enable it. Enabling active resource retention can lead to recycledBitmap
errors orBitmap
re-use bugs if applications callBitmap.recycle()
on any images loaded by Glide or mutate the contents ofBitmap
s loaded by Glide. - Treat devices with API < 19 as having
ActivityManager.isLowRam
set totrue
(#2650, b221d4b)
Breaking Changes
- Removed deprecated constructors requiring
Context
s in most of Glide's defaultTransformation
(23975d9, 733b2e0, 9bedc2b, 55594ba, d8f6224, d840533, 2f76842, 144ac53, 150ebab, 92d761d, a6f1b1c) - The
@NonNull
and@Nullable
annotations added in this release may break builds that depend on compiler plugins that do static nullability analysis, typically due a lack of annotations on any implemenations you might have of Glide's interfaces.
Deprecations
- Deprecated
VideoBitmapDecoder
, useVideoDecoder
instead.
Build Changes
- Glide must be compiled against API 27 (@SUPERCILEX, #2730, 75c2a8b)
- Glide uses v27 of the support libraries (though v26 should work as well, to use v26 of the support library, see Glide's Android SDK requirements docs page)
- Updated to PMD 6.0.0 (@TWiStErRob, f16aef4)
- Fix a PMD failure when building with --profile or any other way in which class files didn't happen to have already been compiled (@TWiStErRob, #2776, fd73179)