README.md
1Glide
2=====
3Glide 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.
4
5Glide'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.
6
7How do I use Glide?
8-------------------
9You 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.
10
11Simple use cases will look something like this:
12
13```Java
14
15//For a simple view:
16@Override
17public void onCreate(Bundle savedInstanceState) {
18 ...
19
20 ImageView imageView = (ImageView) findViewById(R.id.my_image_view);
21
22 Glide.load("http://goo.gl/h8qOq7").into(imageView);
23}
24
25//For a list:
26@Override
27public View getView(int position, View recycled, ViewGroup container) {
28 final ImageView myImageView;
29 if (recycled == null) {
30 myImageView = (ImageView) inflater.inflate(R.layout.my_image_view,
31 container, false);
32 } else {
33 myImageView = (ImageView) recycled;
34 }
35
36 String url = myUrls.get(position);
37
38 Glide.load(url)
39 .centerCrop()
40 .placeholder(R.drawable.loading_spinner)
41 .animate(R.anim.fade_in)
42 .into(myImageView);
43
44 return myImageView;
45}
46
47```
48
49Status
50------
51Glide 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!
52
53Build
54------
55Building Glide with gradle is fairly straight forward:
56
57```
58cd glide/library
59./gradlew build
60```
61
62Note: Make sure your Android SDK has the Android Support Repository installed, and that your `$ANDROID_HOME` environment variable is pointing at the SDK.
63
64Thanks
65------
66Thanks to the Android project and Jake Wharton for the [disk cache implementation](https://github.com/JakeWharton/DiskLruCache) included with Glide. Thanks also to the Android team for [Volley](https://android.googlesource.com/platform/frameworks/volley/).
67
68Author
69------
70Sam Judd - @samajudd
71