• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..--

library/23-Nov-2023-19,78911,647

testutil/src/main/java/com/bumptech/glide/testutil/23-Nov-2023-6236

third_party/23-Nov-2023-4,1412,621

.gitignoreD23-Nov-2023493 3332

.travis.ymlD23-Nov-2023248 1310

Android.bpD23-Nov-20231.6 KiB5249

LICENSED23-Nov-20234.8 KiB9575

METADATAD23-Nov-2023502 2019

MODULE_LICENSE_APACHE2D23-Nov-20230

OWNERSD23-Nov-202369 32

README.mdD23-Nov-20237.1 KiB243191

update_files.shD23-Nov-20232.9 KiB8342

README.md

1Glide
2=====
3
4[![Build Status](https://travis-ci.org/bumptech/glide.svg?branch=master)](https://travis-ci.org/bumptech/glide)
5
6Glide is a fast and efficient open source media management framework for Android that wraps media decoding, memory and
7disk caching, and resource pooling into a simple and easy to use interface.
8
9![](static/glide_logo.png)
10
11Glide supports fetching, decoding, and displaying video stills, images, and animated GIFs. Glide includes a flexible api
12that allows developers to plug in to almost any network stack. By default Glide uses a custom HttpUrlConnection based
13stack, but also includes utility libraries plug in to Google's Volley project or Square's OkHttp library instead.
14
15Glide's primary focus is on making scrolling any kind of a list of images as smooth and fast as possible, but Glide is
16also effective for almost any case where you need to fetch, resize, and display a remote image.
17
18Download
19--------
20You can download a jar from GitHub's [release page](https://github.com/bumptech/glide/releases).
21
22Or use Gradle:
23
24```groovy
25repositories {
26  mavenCentral()
27}
28
29dependencies {
30    compile 'com.github.bumptech.glide:glide:3.3.+'
31    compile 'com.android.support:support-v4:19.1.0'
32}
33```
34
35Or Maven:
36
37```xml
38<dependency>
39  <groupId>com.github.bumptech.glide</groupId>
40  <artifactId>glide</artifactId>
41  <version>3.3.1</version>
42  <type>aar</type>
43</dependency>
44<dependency>
45  <groupId>com.google.android</groupId>
46  <artifactId>support-v4</artifactId>
47  <version>r7</version>
48</dependency>
49```
50
51How do I use Glide?
52-------------------
53Checkout the [GitHub wiki](https://github.com/bumptech/glide/wiki) for pages on a variety of topics, and see the [javadocs](http://bumptech.github.io/glide/javadocs/latest/index.html).
54
55Simple use cases will look something like this:
56
57```Java
58
59// For a simple view:
60@Override
61public void onCreate(Bundle savedInstanceState) {
62    ...
63
64    ImageView imageView = (ImageView) findViewById(R.id.my_image_view);
65
66    Glide.with(this).load("http://goo.gl/h8qOq7").into(imageView);
67}
68
69// For a list:
70@Override
71public View getView(int position, View recycled, ViewGroup container) {
72    final ImageView myImageView;
73    if (recycled == null) {
74        myImageView = (ImageView) inflater.inflate(R.layout.my_image_view,
75                container, false);
76    } else {
77        myImageView = (ImageView) recycled;
78    }
79
80    String url = myUrls.get(position);
81
82    Glide.with(myFragment)
83        .load(url)
84        .centerCrop()
85        .placeholder(R.drawable.loading_spinner)
86        .crossFade()
87        .into(myImageView);
88
89    return myImageView;
90}
91
92```
93
94Volley
95-------
96Volley is now an optional dependency that can be included via a utility library. To use Volley to fetch media over http/https:
97
98With Gradle:
99
100```groovy
101dependencies {
102    compile 'com.github.bumptech.glide:volley-integration:1.0.+'
103    compile 'com.mcxiaoke.volley:library:1.0.+'
104}
105```
106
107Or with Maven:
108
109```xml
110<dependency>
111    <groupId>com.github.bumptech.glide</groupId>
112    <artifactId>volley-integration</artifactId>
113    <version>1.0.1</version>
114    <type>jar</type>
115</dependency>
116<dependency>
117    <groupId>com.mcxiaoke.volley</groupId>
118    <artifactId>library</artifactId>
119    <version>1.0.5</version>
120    <type>aar</type>
121</dependency>
122```
123
124Then in your Activity or Application, register the Volley based model loader:
125```java
126public void onCreate() {
127  Glide.get(this).register(GlideUrl.class, InputStream.class,
128        new VolleyUrlLoader.Factory(yourRequestQueue));
129  ...
130}
131```
132
133After the call to register any requests using http or https will go through Volley.
134
135OkHttp
136------
137In addition to Volley, Glide also includes support for fetching media using OkHttp. To use OkHttp to fetch media over http/https:
138
139With Gradle:
140
141```groovy
142dependencies {
143    compile 'com.github.bumptech.glide:okhttp-integration:1.0.+'
144    compile 'com.squareup.okhttp:okhttp:2.0.+'
145}
146```
147
148Or with Maven:
149
150```xml
151<dependency>
152    <groupId>com.github.bumptech.glide</groupId>
153    <artifactId>okhttp-integration</artifactId>
154    <version>1.0.1</version>
155    <type>jar</type>
156</dependency>
157<dependency>
158    <groupId>com.squareup.okhttp</groupId>
159    <artifactId>okhttp</artifactId>
160    <version>2.0.0</version>
161    <type>jar</type>
162</dependency>
163```
164
165Then in your Activity or Application, register the OkHttp based model loader:
166```java
167public void onCreate() {
168  Glide.get(this).register(GlideUrl.class, InputStream.class,
169        new OkHttpUrlLoader.Factory(yourOkHttpClient));
170  ...
171}
172```
173
174Android SDK Version
175-------------------
176Glide requires a minimum sdk version of 10.
177
178License
179-------
180BSD, part MIT and Apache 2.0. See LICENSE file for details.
181
182Status
183------
184Version 3.x is a stable public release used in multiple open source projects at Google including in the Android Camera app and in the 2014 Google IO app. Comments/bugs/questions/pull requests welcome!
185
186Build
187------
188Building Glide with gradle is fairly straight forward:
189
190```
191git clone git@github.com:bumptech/glide.git
192cd glide
193git submodule init && git submodule update
194./gradlew jar
195```
196
197Note: Make sure your Android SDK has the Android Support Repository installed, and that your `$ANDROID_HOME` environment variable is pointing at the SDK or add a `local.properties` file in the root project with a `sdk.dir=...` line.
198
199Samples
200-------
201Follow the steps in the 'Build' section to setup the project and then:
202
203```
204./gradlew :samples:flickr:run
205./gradlew :samples:giphy:run
206./gradlew :samples:svg:run
207```
208
209Development
210-----------
211Follow the steps in the 'Build' section to setup the project and then edit the files however you wish. Intellij's [IDEA 14 early access build](http://confluence.jetbrains.com/display/IDEADEV/IDEA+14+EAP) cleanly imports both Glide's source and tests and is the recommended way to work with Glide. Earlier versions of intellij do not import the gradle project cleanly. Although Android Studio imports the source cleanly, it is not possible to run or debug the tests without manually modifying the tests' classpath.
212
213To open the project in Intellij 14:
214
2151. Go to File.
2162. Click on 'Open...'
2173. Navigate to Glide's root directory.
2184. Select settings.gradle.
219
220Getting Help
221------------
222To report a specific problem or feature request, [open a new issue on Github](https://github.com/bumptech/glide/issues/new). For questions, suggestions, or anything else, join or email [Glide's discussion group](https://groups.google.com/forum/#!forum/glidelibrary)
223
224Contributing
225------------
226Before submitting pull requests, contributors must sign Google's [individual contribution license agreement](https://developers.google.com/open-source/cla/individual).
227
228Thanks
229------
230* The Android team and Jake Wharton for the [disk cache implementation](https://github.com/JakeWharton/DiskLruCache) Glide's disk cache is based on.
231* Dave Smith for the [gif decoder gist](https://gist.github.com/devunwired/4479231) Glide's gif decoder is based on.
232* Chris Banes for his [gradle-mvn-push](https://github.com/chrisbanes/gradle-mvn-push) script.
233* Corey Hall for Glide's [amazing logo](static/glide_logo.png).
234* Everyone who has contributed code and reported issues!
235
236Author
237------
238Sam Judd - @samajudd
239
240Disclaimer
241---------
242This is not an official Google product.
243