bumptech/glide


An image loading and caching library for Android focused on smooth scrolling

https://bumptech.github.io/glide/

License: Other

Language: Java

Keywords: android, disk-cache, gif, glide, imageloader


Glide

Maven Central Build Status | View Glide's documentation | 简体中文文档 | Report an issue with Glide

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.

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 stack, but also includes utility libraries plug in to Google's Volley project or Square's OkHttp library instead.

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.

Download

For detailed instructions and requirements, see Glide's download and setup docs page.

You can download a jar from GitHub's releases page.

Or use Gradle:

repositories {
  mavenCentral()
  google()
}

dependencies {
  implementation 'com.github.bumptech.glide:glide:4.10.0'
  annotationProcessor 'com.github.bumptech.glide:compiler:4.10.0'
}

Or Maven:

<dependency>
  <groupId>com.github.bumptech.glide</groupId>
  <artifactId>glide</artifactId>
  <version>4.10.0</version>
</dependency>
<dependency>
  <groupId>com.github.bumptech.glide</groupId>
  <artifactId>compiler</artifactId>
  <version>4.10.0</version>
  <optional>true</optional>
</dependency>

For info on using the bleeding edge, see the Snapshots docs page.

ProGuard

Depending on your ProGuard (DexGuard) config and usage, you may need to include the following lines in your proguard.cfg (see the Download and Setup docs page for more details):

-keep public class * implements com.bumptech.glide.module.GlideModule
-keep public class * extends com.bumptech.glide.module.AppGlideModule
-keep public enum com.bumptech.glide.load.ImageHeaderParser$** {
  **[] $VALUES;
  public *;
}

# for DexGuard only
-keepresourcexmlelements manifest/application/meta-data@value=GlideModule

How do I use Glide?

Check out the documentation for pages on a variety of topics, and see the javadocs.

For Glide v3, see the wiki.

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.with(this).load("http://goo.gl/gEgYUd").into(imageView);
}

// For a simple image 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
    .with(myFragment)
    .load(url)
    .centerCrop()
    .placeholder(R.drawable.loading_spinner)
    .into(myImageView);

  return myImageView;
}

Status

Version 4 is now released and stable. Updates are released periodically with new features and bug fixes.

Comments/bugs/questions/pull requests are always welcome! Please read CONTRIBUTING.md on how to report issues.

Compatibility

  • 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.

If you need to support older versions of Android, consider staying on Glide v3, 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.
  • Volley: There is an optional dependency available called volley-integration, see the docs page.
  • Round Pictures: CircleImageView/CircularImageView/RoundedImageView are known to have issues with TransitionDrawable (.crossFade() with .thumbnail() or .placeholder()) and animated GIFs, use a BitmapTransformation (.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 ImageViews as they require special resource optimizations (such as tiling) to work without OutOfMemoryErrors.

Build

Building Glide with gradle is fairly straight forward:

git clone https://github.com/bumptech/glide.git
cd glide
./gradlew jar

Note: 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.

Samples

Follow the steps in the Build section to set up the project and then:

./gradlew :samples:flickr:run
./gradlew :samples:giphy:run
./gradlew :samples:svg:run
./gradlew :samples:contacturi:run

You may also find precompiled APKs on the releases page.

Development

Follow the steps in the Build section to setup the project and then edit the files however you wish. Android Studio cleanly imports both Glide's source and tests and is the recommended way to work with Glide.

To open the project in Android Studio:

  1. Go to File menu or the Welcome Screen
  2. Click on Open...
  3. Navigate to Glide's root directory.
  4. Select setting.gradle

For more details, see the Contributing docs page.

Getting Help

To report a specific problem or feature request, open a new issue on Github. For questions, suggestions, or anything else, email Glide's discussion group, or join our IRC channel: irc.freenode.net#glide-library.

Contributing

Before submitting pull requests, contributors must sign Google's individual contributor license agreement.

Thanks

Author

Sam Judd - @sjudd on GitHub, @samajudd on Twitter

License

BSD, part MIT and Apache 2.0. See the LICENSE file for details.

Disclaimer

This is not an official Google product.

Project Statistics

Sourcerank 18
Repository Size 60.7 MB
Stars 27,824
Forks 5,080
Watchers 1,064
Open issues 141
Dependencies 88
Contributors 111
Tags 37
Created
Last updated
Last pushed

Top Contributors See all

Sam Róbert Papp (TWiStErRob) Alex Saveau glide-copybara-robot Jason Neufeld timurrrr Nathan Naze Christian Williams David Wiesner Jonathan Gerrish Savvas Dalkitsis Tolriq Anton Daubert Richard Liang Jared Burrows Alexander Aprelev Niklas Baudy Liam Miller-Cushon Sergey Antonio Nicolás Pina

Packages Referencing this Repo

Karamunting.AndroidX.BumpTech.Glide.DiskLruCache
A cache that uses a bounded amount of space on a filesystem. Based on Jake Wharton's tailored for...
Latest release 4.10.0-preview01 - Updated - 27.8K stars
Karamunting.AndroidX.BumpTech.Glide.GifDecoder
Implementation of GifDecoder that is more memory efficient to animate for Android devices.
Latest release 4.10.0-preview01 - Updated - 27.8K stars
Karamunting.AndroidX.BumpTech.Glide.Annotations
A set of annotations for configuring Glide
Latest release 4.10.0-preview01 - Updated - 27.8K stars
Karamunting.AndroidX.BumpTech.Glide
A fast and efficient image loading library for Android focused on smooth scrolling.
Latest release 4.9.0 - Published - 27.8K stars
Karamunting.Android.BumpTech.Glide.Integration.OkHttp3
Glide integration library to use OkHttp 3 to fetch data over http/https in Glide
Latest release 4.9.0 - Updated - 27.8K stars
Karamunting.Android.BumpTech.GlideAnnotations
A set of annotations for configuring Glide.
Latest release 4.9.0 - Updated - 27.8K stars
Karamunting.Android.BumpTech.GlideGifDecoder
Implementation of GifDecoder that is more memory efficient to animate for Android devices.
Latest release 4.9.0 - Updated - 27.8K stars
Karamunting.Android.BumpTech.Glide
A fast and efficient image loading library for Android focused on smooth scrolling.
Latest release 4.9.0 - Updated - 27.8K stars
Karamunting.Android.BumpTech.GlideDiskLruCache
A cache that uses a bounded amount of space on a filesystem. Based on Jake Wharton's tailored for...
Latest release 4.9.0 - Updated - 27.8K stars
com.github.bumptech.glide:recyclerview-integration
An integration library to display images in RecyclerView.
Latest release 4.8.0 - Updated - 27.8K stars
com.github.bumptech.glide:compiler
Glide's anntation processor. Should be included in all Applications and in all libraries that use...
Latest release 4.8.0 - Updated - 27.8K stars
com.github.bumptech.glide:okhttp3-integration
An integration library to use OkHttp 3.x to fetch data over http/https in Glide
Latest release 4.8.0 - Updated - 27.8K stars
com.github.bumptech.glide:glide
A fast and efficient image loading library for Android focused on smooth scrolling.
Latest release 4.8.0 - Updated - 27.8K stars
com.github.bumptech.glide:okhttp-integration
An integration library to use OkHttp to fetch data over http/https in Glide
Latest release 4.7.1 - Updated - 27.8K stars
Karamunting.AndroidX.BumpTech.Glide.Integration.RecyclerView
Glide integration library to display images in RecyclerView
Latest release 4.9.0 - Published - 27.8K stars
com.github.bumptech.glide:annotations
A set of annotations for configuring Glide.
Latest release 4.8.0 - Updated - 27.8K stars
Karamunting.AndroidX.BumpTech.Glide.Integration.OkHttp3
Glide integration library to use OkHttp 3 to fetch data over http/https in Glide
Latest release 4.9.0 - Published - 27.8K stars
Glide.Droid
glide-3.7.0 绑定信息介绍 https://github.com/dadycoding/XamainAndroidBindLibary
Latest release 1.0.0 - Published - 27.8K stars
Karamunting.Android.BumpTech.Glide.Integration.RecyclerView
Glide integration library to display images in RecyclerView
Latest release 4.9.0 - Updated - 27.8K stars
com.github.bumptech.glide:volley-integration
An integration library to use Volley to fetch data over http/https in Glide
Latest release 4.7.1 - Updated - 27.8K stars

Recent Tags See all

v4.10.0 September 18, 2019
v4.9.0 February 14, 2019
v4.8.0 August 16, 2018
v4.7.1 April 13, 2018
v4.7.0 April 10, 2018
v4.6.1 February 02, 2018
v4.6.0 February 01, 2018
v4.5.0 January 05, 2018
v4.4.0 December 04, 2017
v4.3.1 November 06, 2017
v4.3.0 October 31, 2017
v4.2.0 October 03, 2017
v4.1.1 September 05, 2017
v4.1.0 September 01, 2017
v4.0.0 August 01, 2017

Interesting Forks See all

airbnb/glide
An image loading and caching library for Android focused on smooth scrolling
Java - Other - Last pushed - 25 stars - 7 forks
sjudd/glide
An image loading and caching library for Android focused on smooth scrolling
Java - Other - Last pushed - 5 stars - 3 forks
TWiStErRob/glide
An image loading and caching library for Android focused on smooth scrolling
Java - Other - Last pushed - 5 stars - 1 forks
motain/android-Glide
An image loading and caching library for Android focused on smooth scrolling
Java - Other - Last pushed - 4 stars - 4 forks
zhengbobin/glide
An image loading and caching library for Android focused on smooth scrolling
Java - Updated - 2 stars

Something wrong with this page? Make a suggestion

Last synced: 2019-12-04 17:19:19 UTC

Login to resync this repository