commit | 7d5beadceb1f3d6feb68aca766521d92a9519713 | [log] [tgz] |
---|---|---|
author | Sam Judd <sam@bu.mp> | Sat Aug 17 09:46:01 2013 -0700 |
committer | Sam Judd <sam@bu.mp> | Sat Aug 17 09:47:14 2013 -0700 |
tree | b9ee8307f10599b6d49a6ebf07011f6dbdcce977 | |
parent | 9c04fc7a0c1d5c9e8f54660b0f954f754100f250 [diff] |
Allow arbitrary uri loader in resource loader Lets us use factory for uris rather than relying on our specific implementation
Glide is fast and efficient image loading library for Android that wraps image downloading, resizing, memory and disk caching, and bitmap recycling into one simple and easy to use interface. By default, Glide includes an implementation for fetching images over http based on Google's Volley project for fast, parallelized network operations on Android.
Glide's primary focus is on making scrolling any kind of a list of images as smooth and fast as possible, but Glide is also effective for almost any case where you need to fetch, resize, and display a remote image.
You can download a .jar from GitHub's release page for the Glide project. The wiki also has tutorials on a variety of topics and the javadocs for version 2.0+ will also be available via a link there as well.
Simple use cases will look something like this:
//For a simple view: @Override public void onCreate(Bundle savedInstanceState) { ... ImageView imageView = (ImageView) findViewById(R.id.my_image_view); Glide.load("http://goo.gl/h8qOq7").into(imageView); } //For a list: @Override public View getView(int position, View recycled, ViewGroup container) { if (recycled == null) { myImageView = (ImageView) inflater.inflate(R.layout.my_image_view, container, false); } else { myImageView = (ImageView) recycled); } String url = myUrls.get(position); Glide.load(url) .centerCrop() .placeholder(R.drawable.loading_spinner) .animate(R.anim.fade_in) .into(myImageView); return myImageView; }
Glide has been in use at Bump for about six months in two of our Android apps at version 1.0. Version 2.0 is the first public release with a stable api. Comments/bugs/questions/pull requests welcome!
Thanks to the Android project and Jake Wharton for the disk cache implementation included with Glide, and also to Square and Picasso for Glide's high level api. Thanks also to the Android team for Volley.
Sam Judd - sam.a.judd@gmail.com @samajudd