tag | 2465e6a008182e4f5bbfb0bdb6011b6a3979d67a | |
---|---|---|
tagger | The Android Open Source Project <initial-contribution@android.com> | Mon Feb 01 19:15:45 2016 -0800 |
object | 3dddc8773c50852bc592b8bc32d92eb153ce8dba |
Android CTS 5.0 release 4
commit | 3dddc8773c50852bc592b8bc32d92eb153ce8dba | [log] [tgz] |
---|---|---|
author | Alan Newberger <alann@google.com> | Sun Sep 21 16:19:39 2014 -0700 |
committer | Alan Newberger <alann@google.com> | Sun Sep 28 05:34:13 2014 +0000 |
tree | f79e05c61c198dadeee34056b9bc8ed6c17247a7 | |
parent | 4dafca5f35492fb1e7dc1e8a82da05345dee7cf2 [diff] |
Migrate Glide to default to ALWAYS_ARGB_8888 Due to issues where we were seeing Camera builds request 8888 and not always get it, employ a simple fix to just change Glide defaults for Android across the board to 8888. The BitmapDecoders are what really matter for Camera, changing the Builder as well for consistency. Also added cache debugging lines to Engine to characterize issue. Bug: 17523927 Change-Id: I10827561d0dbfc9e22365cceee16e030329071ff (cherry picked from commit 39cf2a57e54423787928bd310ebf9aed2f274f15)
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 pages 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) { final ImageView myImageView; 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!
Building Glide with gradle is fairly straight forward:
cd glide/library ./gradlew build
Note: Make sure your Android SDK has the Android Support Repository installed, and that your $ANDROID_HOME
environment variable is pointing at the SDK.
Thanks to the Android project and Jake Wharton for the disk cache implementation included with Glide. Thanks also to the Android team for Volley.
Sam Judd - @samajudd