2013-07-08 16:50:54 -07:00
Glide
=====
2014-08-31 13:59:16 -07:00
2023-03-28 17:12:29 -07:00
[](https://maven-badges.herokuapp.com/maven-central/com.github.bumptech.glide/glide)
2017-09-18 22:14:57 +08:00
| [View Glide's documentation][20] | [简体中文文档][22] | [Report an issue with Glide][5]
2014-08-31 13:59:16 -07:00
2015-02-03 19:12:36 -08:00
Glide is a fast and efficient open source media management and image loading framework for Android that wraps media
decoding, memory and disk caching, and resource pooling into a simple and easy to use interface.
2014-09-04 19:20:01 -07:00

2015-08-05 13:46:07 +02:00
Glide supports fetching, decoding, and displaying video stills, images, and animated GIFs. Glide includes a flexible API
that allows developers to plug in to almost any network stack. By default Glide uses a custom `HttpUrlConnection` based
2014-09-04 19:20:01 -07:00
stack, but also includes utility libraries plug in to Google's Volley project or Square's OkHttp library instead.
2013-07-08 16:50:54 -07:00
2014-06-28 11:05:23 -07:00
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.
2013-07-08 16:50:54 -07:00
2014-06-26 18:00:01 -07:00
Download
--------
2018-01-02 21:22:46 -08:00
For detailed instructions and requirements, see Glide's [download and setup docs page][28].
2014-11-19 19:02:31 -08:00
You can download a jar from GitHub's [releases page][1].
2014-08-31 19:57:55 -07:00
Or use Gradle:
2014-06-26 18:00:01 -07:00
2015-08-05 13:46:07 +02:00
``` gradle
2014-06-26 18:00:01 -07:00
repositories {
2025-10-31 13:51:22 -07:00
google ( )
2021-03-09 00:27:40 -05:00
mavenCentral ( )
2014-06-26 18:00:01 -07:00
}
dependencies {
2025-10-31 13:51:22 -07:00
implementation 'com.github.bumptech.glide:glide:5.0.5'
2014-06-26 18:00:01 -07:00
}
```
Or Maven:
``` xml
<dependency >
2016-03-03 18:06:25 -08:00
<groupId > com.github.bumptech.glide</groupId>
<artifactId > glide</artifactId>
2025-09-12 16:52:54 -07:00
<version > 5.0.5</version>
2017-05-18 07:03:45 -07:00
</dependency>
2014-06-26 18:00:01 -07:00
```
2017-12-03 16:24:07 -08:00
For info on using the bleeding edge, see the [Snapshots][17] docs page.
2016-03-03 18:06:25 -08:00
2022-08-19 10:30:49 +08:00
R8 / Proguard
2015-04-20 07:18:54 -07:00
--------
2022-08-19 10:30:49 +08:00
The specific rules are [already bundled ](library/proguard-rules.txt ) into the aar which can be interpreted by R8 automatically
2015-04-20 07:18:54 -07:00
2013-07-11 15:40:13 -07:00
How do I use Glide?
2013-07-08 16:50:54 -07:00
-------------------
2017-07-31 18:55:44 -07:00
Check out the [documentation][20] for pages on a variety of topics, and see the [javadocs][3].
2017-05-18 07:03:45 -07:00
For Glide v3, see the [wiki][2].
2013-07-08 16:50:54 -07:00
2019-02-14 12:53:51 -08:00
Simple use cases will look something like this:
2013-07-08 16:50:54 -07:00
2015-08-05 13:46:07 +02:00
``` java
2014-08-21 07:34:57 -07:00
// For a simple view:
2016-03-03 18:06:25 -08:00
@Override public void onCreate ( Bundle savedInstanceState ) {
. . .
ImageView imageView = ( ImageView ) findViewById ( R . id . my_image_view ) ;
2013-07-28 14:29:44 -07:00
2023-03-09 09:43:24 +01:00
Glide . with ( this ) . load ( " https://goo.gl/gEgYUd " ) . into ( imageView ) ;
2013-07-28 14:29:44 -07:00
}
2015-08-05 13:46:07 +02:00
// For a simple image list:
2016-03-03 18:06:25 -08:00
@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 ) ;
2019-02-14 12:53:51 -08:00
Glide
2016-03-03 18:06:25 -08:00
. with ( myFragment )
. load ( url )
. centerCrop ( )
. placeholder ( R . drawable . loading_spinner )
. into ( myImageView ) ;
return myImageView ;
2013-07-22 11:47:39 -07:00
}
2013-07-08 16:50:54 -07:00
```
2016-04-08 12:12:39 -07:00
Status
------
2019-02-14 12:53:51 -08:00
Version 4 is now released and stable. Updates are released periodically with new features and bug fixes.
2016-03-03 18:06:25 -08:00
Comments/bugs/questions/pull requests are always welcome! Please read [CONTRIBUTING.md][5] on how to report issues.
Compatibility
-------------
2017-12-02 18:35:53 -08:00
* **Minimum Android SDK**: Glide v4 requires a minimum API level of 14.
* **Compile Android SDK**: Glide v4 requires you to compile against API 26 or later.
2017-09-14 16:28:01 -07:00
2017-12-02 18:35:53 -08:00
If you need to support older versions of Android, consider staying on [Glide v3][14], which works on API 10, but is not actively maintained.
* **OkHttp 3.x**: There is an optional dependency available called `okhttp3-integration` , see the [docs page][23].
* **Volley**: There is an optional dependency available called `volley-integration` , see the [docs page][24].
2016-03-03 18:06:25 -08:00
* **Round Pictures**: `CircleImageView` /`CircularImageView` /`RoundedImageView` are known to have [issues][18] with `TransitionDrawable` (`.crossFade()` with `.thumbnail()` or `.placeholder()` ) and animated GIFs, use a [`BitmapTransformation` ][19] (`.circleCrop()` will be available in v4) or `.dontAnimate()` to fix the issue.
* **Huge Images** (maps, comic strips): Glide can load huge images by downsampling them, but does not support zooming and panning `ImageView` s as they require special resource optimizations (such as tiling) to work without `OutOfMemoryError` s.
2013-07-22 11:47:39 -07:00
2014-06-21 01:18:16 -07:00
Build
2015-10-17 02:01:08 +02:00
-----
2014-06-21 01:18:16 -07:00
Building Glide with gradle is fairly straight forward:
2015-08-05 13:46:07 +02:00
``` shell
2019-02-14 12:53:51 -08:00
git clone https://github.com/bumptech/glide.git
2014-07-08 19:14:28 -07:00
cd glide
2014-08-17 10:16:29 -07:00
./gradlew jar
2014-06-21 01:18:16 -07:00
```
2015-08-05 13:46:07 +02:00
**Note ** : Make sure your * Android SDK * has the * Android Support Repository * installed, and that your `$ANDROID_HOME` environment
2014-11-19 19:02:31 -08:00
variable is pointing at the SDK or add a `local.properties` file in the root project with a `sdk.dir=...` line.
2014-08-29 16:28:43 +02:00
Samples
-------
2017-07-31 18:55:44 -07:00
Follow the steps in the [Build ](#build ) section to set up the project and then:
2014-08-29 16:28:43 +02:00
2015-08-05 13:46:07 +02:00
``` shell
2014-09-04 19:20:01 -07:00
./gradlew :samples:flickr:run
./gradlew :samples:giphy:run
./gradlew :samples:svg:run
2017-08-15 02:03:51 +02:00
./gradlew :samples:contacturi:run
2014-08-29 16:28:43 +02:00
```
2015-08-05 13:46:07 +02:00
You may also find precompiled APKs on the [releases page][1].
2014-06-21 01:18:16 -07:00
2014-08-17 10:16:29 -07:00
Development
-----------
2015-08-05 13:46:07 +02:00
Follow the steps in the [Build ](#build ) section to setup the project and then edit the files however you wish.
2017-12-03 16:24:07 -08:00
[Android Studio][26] cleanly imports both Glide's source and tests and is the recommended way to work with Glide.
2014-09-04 19:20:01 -07:00
2017-12-03 16:24:07 -08:00
To open the project in Android Studio:
2014-09-04 19:20:01 -07:00
2015-08-05 13:46:07 +02:00
1. Go to * File * menu or the * Welcome Screen *
2. Click on * Open... *
2014-09-04 19:20:01 -07:00
3. Navigate to Glide's root directory.
2017-12-03 16:24:07 -08:00
4. Select `setting.gradle`
For more details, see the [Contributing docs page][27].
2014-08-21 07:34:57 -07:00
Getting Help
------------
2014-11-19 19:02:31 -08:00
To report a specific problem or feature request, [open a new issue on Github][5]. For questions, suggestions, or
2016-03-18 20:43:11 +01:00
anything else, email [Glide's discussion group][6], or join our IRC channel: [irc.freenode.net#glide -library][13].
2014-08-21 07:34:57 -07:00
Contributing
------------
2015-02-08 17:26:10 -08:00
Before submitting pull requests, contributors must sign Google's [individual contributor license agreement][7].
2014-08-17 10:16:29 -07:00
2013-07-22 11:47:39 -07:00
Thanks
------
2015-08-05 13:46:07 +02:00
* The * *Android team** and **Jake Wharton ** for the [disk cache implementation][8] Glide's disk cache is based on.
2016-07-13 20:21:42 +02:00
* * *Dave Smith** for the [GIF decoder gist][9] Glide's GIF decoder is based on.
2015-08-05 13:46:07 +02:00
* * *Chris Banes** for his [gradle-mvn-push][10] script.
* * *Corey Hall** for Glide's [amazing logo][11].
2014-09-04 19:20:01 -07:00
* Everyone who has contributed code and reported issues!
2013-08-09 09:58:33 -07:00
Author
------
2016-03-03 18:06:25 -08:00
Sam Judd - @sjudd on GitHub, @samajudd on Twitter
License
-------
BSD, part MIT and Apache 2.0. See the [LICENSE][16] file for details.
2014-08-21 07:34:57 -07:00
Disclaimer
---------
This is not an official Google product.
2014-11-19 19:02:31 -08:00
[1]: https://github.com/bumptech/glide/releases
[2]: https://github.com/bumptech/glide/wiki
2017-11-25 00:03:12 +05:30
[3]: https://bumptech.github.io/glide/ref/javadocs.html
2014-11-19 19:02:31 -08:00
[4]: https://www.jetbrains.com/idea/download/
2016-03-03 18:06:25 -08:00
[5]: https://github.com/bumptech/glide/blob/master/CONTRIBUTING.md
2014-11-19 19:02:31 -08:00
[6]: https://groups.google.com/forum/#!forum/glidelibrary
[7]: https://developers.google.com/open-source/cla/individual
[8]: https://github.com/JakeWharton/DiskLruCache
[9]: https://gist.github.com/devunwired/4479231
[10]: https://github.com/chrisbanes/gradle-mvn-push
2015-01-24 09:42:28 -08:00
[11]: static/glide_logo.png
2015-01-29 18:33:38 -08:00
[12]: https://github.com/bumptech/glide/wiki/Integration-Libraries
2015-02-03 08:48:39 -08:00
[13]: http://webchat.freenode.net/?channels=glide-library
2015-08-05 13:46:07 +02:00
[14]: https://github.com/bumptech/glide/tree/3.0
[15]: https://github.com/bumptech/glide/tree/master
2015-10-30 12:19:56 -07:00
[16]: https://github.com/bumptech/glide/blob/master/LICENSE
2017-12-03 16:24:07 -08:00
[17]: http://bumptech.github.io/glide/dev/snapshots.html
2016-03-03 18:06:25 -08:00
[18]: https://github.com/bumptech/glide/issues?q=is%3Aissue+CircleImageView+OR+CircularImageView+OR+RoundedImageView
2016-07-13 20:21:42 +02:00
[19]: https://github.com/wasabeef/glide-transformations
2017-11-25 00:03:12 +05:30
[20]: https://bumptech.github.io/glide/
2017-10-03 23:00:47 +09:00
[22]: https://muyangmin.github.io/glide-docs-cn/
2017-12-02 18:35:53 -08:00
[23]: http://bumptech.github.io/glide/int/okhttp3.html
[24]: http://bumptech.github.io/glide/int/volley.html
2017-12-03 16:24:07 -08:00
[25]: http://bumptech.github.io/glide/doc/download-setup.html#proguard
[26]: https://developer.android.com/studio/index.html
[27]: http://bumptech.github.io/glide/dev/contributing.html
2018-01-02 21:22:46 -08:00
[28]: http://bumptech.github.io/glide/doc/download-setup.html