Glide 4.3.0
This is the October release of Glide.
Features
- Added a
DiskLruCacheFactory
implementation that falls back to the internal cache directory on devices where the external cache directory isn't available (#24, 56a4275, thanks to @anpez) - Added an
error
API to start a new load if the primary load fails.
See the docs page for usage. (b06b0cc), - Added support for decoding non-
Bitmap
Drawables
and for transforming most of those types ofDrawables
. AnimatedDrawables
may be loaded if they're supported by the framework or support library, but can't be transformed. Consider usingoptionalTransform
if you want to try to transform non-Bitmap
resources but don't want your loads to fail if transformations can't be applied. (#350, a0628b8, 7614e10, fc4a456, 90f1cc9) - Added a helper method to avoid nesting when applying multiple levels of thumbnails (bc1b25e)
- Pass the
Context
provided toGlide.with()
(either the actualContext
or theContext
of the givenFragment
orActivity
) into Glide's requests. As a result, Glide will use theTheme
of the providedContext
automatically. Callers can override the defaultTheme
with thetheme()
option (#1267, bbb25af). - Pass through exception messages to
RequestFutureTarget
.
Previously all load failures would throw anExecutionException
with a more or less useless generic error message and stack trace. Now theExceptionMessage
will contain the same failure message that you see logged with the Glide log tag. (65048a4) - Added support for passing
Bitmap
s andDrawable
s into.load()
(7663c21)
Bugs
- Added
@CheckResult
to most intermediate builder methods in Glide's various builder classes to avoid errors where developers ignore the results and end up ignoring the options they'd tried to apply (739cb35, 28e461e, thanks to @TWiStErRob) - Avoid a concurrency bug in the platform on more varieties of Moto Xs (1e2fb23)
- Fixed an integer overflow when upscaling images in
Downsampler
(#2459, c7383b2) - Fixed a couple of import style nits (6cd8289, thanks to @brettchabot)
- Added a separate executor to decode GIF frames on to avoid stuttering when scrolling through lists of GIFs that was caused by Glide's normal threads being blocked by I/O or decoding GIF headers (#899, c4db04e).
- Fixed corrupt images caused by the
RoundedCorners
transformation (#2472, 0b5d1bc). - Removed an inaccurate Precondition that obfuscated the reasons for load failures (#2462, 890454a)
- Avoid failing requests for Files types that can't be mmaped (cbe9f42, thanks to @pkorth).
- Fixed a crash performing network operations when using a
GlideExecutor
with a customUncaughtExceptionHandler
(#2508, e6e2aef, thanks to @stephanenicolas) - Fixed Glide's Futures from blocking forever if the Request or a custom component throws an unexpected exception (74fcad1)
- Avoid showing incorrect frames when pausing/restarting GIFs (#2526, 90b3b9f)
Build
- Fixed a bunch of warnings and compile time noise and cleaned up a variety of build files and versions (#2426, thanks to @TWiStErRob)
- Fixed duplicate class files in the compiler jar (#2452m, 7c09fc1)
Behavior Changes
- Include the presence or absence (but not equality of)
RequestListeners
when determining whether or not to ignore new Requests as part of an ongoing effort to avoid unnecessary restarts of in progress loads (#2270, 95caa05). - Default GIFs to using ARGB_8888 instead of RGB_565 and add an API to specify the preferred format for GIFs specifically. As a result both GIF quality and memory usage will increase. For details on configuring the format, see the javadocs (#2396, 6f91031).
Breaking Changes
GlideException
sgetRootCauses()
method will now return aList
ofThrowable
instead ofException
. Doing so allows us to better handle certain expectedError
s, likeOutOfMemoryException
that otherwise have to be caught by ourExecutor
and swallowed. This change was made as part of avoiding behavior in Glide's Futures that could cause them to block forever (74fcad1).