commit | 93988c0256d2bbd47ca5d45b316efe9de7dbfd5f | [log] [tgz] |
---|---|---|
author | Sam Judd <sam@bu.mp> | Thu Jul 25 22:16:59 2013 -0700 |
committer | Sam Judd <sam@bu.mp> | Thu Jul 25 22:16:59 2013 -0700 |
tree | 5ba15f6f190307b2b73de4e2a4236a2c15faa9be | |
parent | 944080485b6f0b1f412ae9f33cc49088cc8e39a9 [diff] |
Base FileLoader on UriLoader removes some duplicated code.
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