commit | 612bb49c9045a723e2da145ef3647707b731b6c6 | [log] [tgz] |
---|---|---|
author | Sam Judd <sam@bu.mp> | Fri Jul 26 10:18:45 2013 -0700 |
committer | Sam Judd <sam@bu.mp> | Tue Jul 30 17:30:10 2013 -0700 |
tree | 8caec05ee80746ac14448fcc1bdb64e53b1fee99 | |
parent | 388a07251f6558aac332bab015193db9cadadd3f [diff] |
Tag views with ImagePresenters in constructor This should be safe since we're using tag with an id and it eliminates one extra step required to use ImagePresenters.
Glide is an all in one image download and resizing library for Android that wraps image downloading, resizing, memory and disk caching, and bitmap recycling into one simple and easy to use interface. Glide includes an implementation for fetching images over http based on Google's Volley project for fast, parallelized network operations on Android.
Glide works best for long lists or grids where every item contains an image or images, but it's also effective for almost any case where you need to fetch, resize, and display a remote image.
The GitHub project wiki has tutorials on a variety of topics, including basic usage and adding Glide to a project. The javadocs for version 1.0+ will also be available via a link on the wiki.
Simple use cases will look something like this:
@Override public View getView(int position, View recycled, ViewGroup container) { final ImageView myImageView; if (recycled == null) { myImageView = (ImageView) inflater.inflate(R.layout.my_image_view, container, false); } else { myImageView = (ImageView) recycled); } URL myUrl = myUrls.get(position); Glide.load(myUrl).into(myImageView).centerCrop().animate(R.anim.fade_in).begin(); return myImageView; }
Glide has been in use at Bump for about six months in two of our Android apps. The API after 1.0 is mostly stable though there may be some superficial changes. Comments/bugs/questions/pull requests welcome!
Thanks to the Android project and Jake Wharton for the disk cache implementation included with Glide. Thanks also to the Android team for Volley