Glide 3.6.0
Glide 3.6.0 is a bugfix and minor feature release of the open source image loading library for Android focused on smooth scrolling.
Features
Glide.get(context).clearDiskCache()
glideBuilder.setDiskCache(new InternalDiskCacheFactory(context, 10 * 1024 * 1024));
// or:
glideBuilder.setDiskCache(new ExternalDiskCacheFactory(context, "cache_dir", 10 * 1024 * 1024));
- Add a fallback drawable to display for null models (#268)
Glide.with(context)
.load(maybeNull)
.placeholder(R.drawable.loading)
.error(R.drawable.failed)
.fallback(R.drawable.empty)
.into(imageView)
- Add a method to
ViewTarget
to globally set an id to use withsetTag
public class FlickrGlideModule implements GlideModule {
@Override
public void applyOptions(Context context, GlideBuilder builder) {
// Warning: This may cause memory leaks on versions of Android less than 4.0
ViewTarget.setTagId(R.id.glide_tag_id);
}
...
}
- Allow requests to be paused/resumed recursively for Activities and/or Fragments and their child fragments (5210ba8, thanks to Paul)
Glide.with(getActivity()).pauseRequestsRecursive();
// And later:
Glide.with(getActivity()).resumeRequestsRecursive();
- Add support for http headers to GlideUrl (fee6ed6, thanks to Ozzie)
// In your ModelLoader:
GlideUrl glideUrl = new GlideUrl("url", new LazyHeaders.Builder()
.addHeader("key1", "value")
.addHeader("key2", new LazyHeaderFactory() {
@Override
public String buildHeader() {
String expensiveAuthHeader = computeExpensiveAuthHeader();
return expensiveAuthHeader;
}
})
.build())
- Add somewhat more robust handling of uncaught exceptions (#435)
- Add a custom request factory for the Volley integration library (3dcad68, thanks to Jason)
Build/Infrastructure
- Get Glide building on Windows (#312, thanks to @TWiStErRob)
- Cleanup more warning (#445, thanks to @TWiStErRob)
Bugs
- Check the response code in OkHttp integration library (#315)
- Fix a crash mutating SquaringDrawable (#349)
- Removed an unnecessary anti alias flag in the paint used for default transformations (#366)
- Fix an NPE when the disk cache directory could not be created (#374)
- Fix a concurrent modification starting requests when other requests complete/fail (#375)
- Ensure preload targets are always cleared (#385)
- Handle reading/skipping less than expected data in ImageHeaderParser (#387)
- Work around a framework bug decoding webp images from InputStreams by basing available() on the content length (#392)
- Always obey custom cross fade duration (#398)
- Work around a framework issue where media store thumbs are not rotated (#400)
- Fix an NPE in
RequestFutureTarget
(#401, thanks to @Tolriq) - Avoid throwing exceptions when provided invalid resource ids (#413)
- Improve the error message when asked to load the empty string (#415)
- Fix a race in DecodeJob's cancel method (#424)
- Fix a race where downloading the same url twice with difference keys using
SOURCE
orALL
could cause the load to fail (#427) - Fix a calculation error in
Downsampler.AT_MOST
(#434) - Make sure code style in OkHttp library is consistent (#397, thanks to @floating-cat)
- Fix a bitmap re-use bug during cross fades (a9f80ea)