Clone this repo:
  1. 62b6a48 Update glide dependencies to androidx am: 7d5ffbf62c am: 0aa3436fcd am: 785f867685 am: 6f8b1fbb07 am: d7e6aacf5e by Trevor Radcliffe · 2 years, 9 months ago aml_hef_341811030 aml_rkp_341810000 android14-d2-release android14-d2-s1-release android14-d2-s2-release android14-d2-s3-release android14-d2-s4-release android14-d2-s5-release android14-dev android14-mainline-healthfitness-release android14-prebuilt-test android14-qpr1-automotiveos-release android14-qpr1-release android14-qpr1-s2-release android14-qpr2-release android14-qpr2-s1-release android14-qpr2-s2-release android14-qpr2-s3-release android14-qpr2-s4-release android14-qpr2-s5-release android14-qpr3-d1-release android14-qpr3-d1-s1-release android14-qpr3-d1-s2-release android14-qpr3-d1-s3-release android14-qpr3-release android14-qpr3-s10-release android14-qpr3-s11-release android14-qpr3-s12-release android14-qpr3-s13-release android14-qpr3-s14-release android14-qpr3-s15-release android14-qpr3-s2-release android14-qpr3-s3-release android14-qpr3-s4-release android14-qpr3-s5-release android14-qpr3-s6-release android14-qpr3-s7-release android14-qpr3-s8-release android14-qpr3-s9-release android15-platform-release android15-prebuilt-test android15-qpr1-release android15-release android15-s1-release android15-security-release android15-tests-dev android15-tests-release main master aml_cfg_341510000 aml_cfg_351010000 aml_hef_341114030 aml_hef_341311010 aml_hef_341415040 aml_hef_341512030 aml_hef_341613000 aml_hef_341717050 aml_hef_341811030 aml_hef_350921160 aml_hef_351016140 aml_rkp_341012000 aml_rkp_341015010 aml_rkp_341114000 aml_rkp_341311000 aml_rkp_341510000 aml_rkp_341810000 aml_rkp_350910000 aml_rkp_351011000 aml_tz6_351010000 android-14.0.0_r16 android-14.0.0_r17 android-14.0.0_r18 android-14.0.0_r19 android-14.0.0_r20 android-14.0.0_r21 android-14.0.0_r22 android-14.0.0_r23 android-14.0.0_r24 android-14.0.0_r25 android-14.0.0_r26 android-14.0.0_r27 android-14.0.0_r29 android-14.0.0_r30 android-14.0.0_r31 android-14.0.0_r32 android-14.0.0_r33 android-14.0.0_r34 android-14.0.0_r35 android-14.0.0_r36 android-14.0.0_r37 android-14.0.0_r38 android-14.0.0_r39 android-14.0.0_r40 android-14.0.0_r41 android-14.0.0_r42 android-14.0.0_r43 android-14.0.0_r44 android-14.0.0_r45 android-14.0.0_r50 android-14.0.0_r51 android-14.0.0_r52 android-14.0.0_r53 android-14.0.0_r54 android-14.0.0_r55 android-14.0.0_r56 android-14.0.0_r57 android-14.0.0_r58 android-14.0.0_r59 android-14.0.0_r60 android-14.0.0_r61 android-14.0.0_r62 android-14.0.0_r63 android-14.0.0_r64 android-14.0.0_r65 android-14.0.0_r66 android-14.0.0_r67 android-14.0.0_r68 android-14.0.0_r69 android-14.0.0_r70 android-14.0.0_r71 android-14.0.0_r72 android-14.0.0_r73 android-14.0.0_r74 android-14.0.0_r75 android-15.0.0_r1 android-15.0.0_r2 android-15.0.0_r3 android-15.0.0_r4 android-15.0.0_r5 android-15.0.0_r6 android-15.0.0_r7 android-15.0.0_r8 android-automotiveos-14.0.0_lts2 android-automotiveos-14.0.0_lts3 android-cts-15.0_r1 android-cts-15.0_r2 android-platform-15.0.0_r1 android-platform-15.0.0_r2 android-platform-15.0.0_r3 android-security-15.0.0_r1 android-security-15.0.0_r2 android-security-15.0.0_r3 android-vts-15.0_r1 android-vts-15.0_r2
  2. d7e6aac Update glide dependencies to androidx am: 7d5ffbf62c am: 0aa3436fcd am: 785f867685 am: 6f8b1fbb07 by Trevor Radcliffe · 2 years, 9 months ago aml_tz4_332714010 android13-mainline-appsearch-release android13-mainline-tzdata4-release aml_ase_331011020 aml_ase_331112000 aml_ase_331311020 aml_tz4_331012000 aml_tz4_331012040 aml_tz4_331012050 aml_tz4_331314010 aml_tz4_331314020 aml_tz4_331314030 aml_tz4_331910000 aml_tz4_332714010 aml_tz4_332714050 aml_tz4_332714070 aml_tz4_332714200
  3. bbb7f4e Update glide dependencies to androidx am: 7d5ffbf62c am: 0aa3436fcd am: 785f867685 am: 6f8b1fbb07 by Trevor Radcliffe · 2 years, 9 months ago
  4. 6f8b1fb Update glide dependencies to androidx am: 7d5ffbf62c am: 0aa3436fcd am: 785f867685 by Trevor Radcliffe · 2 years, 9 months ago android13-d3-s1-release android13-d4-release android13-d4-s1-release android13-d4-s2-release android13-dev android13-frc-odp-release android13-mainline-go-adservices-release android13-prebuilt-test android13-qpr2-b-s1-release android13-qpr2-release android13-qpr2-s1-release android13-qpr2-s10-release android13-qpr2-s11-release android13-qpr2-s12-release android13-qpr2-s2-release android13-qpr2-s3-release android13-qpr2-s5-release android13-qpr2-s6-release android13-qpr2-s7-release android13-qpr2-s8-release android13-qpr2-s9-release android13-qpr3-c-s1-release android13-qpr3-c-s10-release android13-qpr3-c-s11-release android13-qpr3-c-s12-release android13-qpr3-c-s2-release android13-qpr3-c-s3-release android13-qpr3-c-s4-release android13-qpr3-c-s5-release android13-qpr3-c-s6-release android13-qpr3-c-s7-release android13-qpr3-c-s8-release android13-qpr3-release android13-qpr3-s1-release android13-qpr3-s10-release android13-qpr3-s11-release android13-qpr3-s12-release android13-qpr3-s13-release android13-qpr3-s14-release android13-qpr3-s2-release android13-qpr3-s3-release android13-qpr3-s4-release android13-qpr3-s5-release android13-qpr3-s6-release android13-qpr3-s7-release android13-qpr3-s8-release android13-qpr3-s9-release main-16k main-16k-with-phones aml_go_ads_330913000 aml_go_ads_330915000 aml_go_ads_330915100 aml_go_odp_330912000 android-13.0.0_r32 android-13.0.0_r33 android-13.0.0_r34 android-13.0.0_r35 android-13.0.0_r36 android-13.0.0_r37 android-13.0.0_r38 android-13.0.0_r39 android-13.0.0_r40 android-13.0.0_r41 android-13.0.0_r42 android-13.0.0_r43 android-13.0.0_r44 android-13.0.0_r45 android-13.0.0_r46 android-13.0.0_r47 android-13.0.0_r48 android-13.0.0_r49 android-13.0.0_r50 android-13.0.0_r51 android-13.0.0_r52 android-13.0.0_r53 android-13.0.0_r54 android-13.0.0_r56 android-13.0.0_r57 android-13.0.0_r58 android-13.0.0_r59 android-13.0.0_r60 android-13.0.0_r61 android-13.0.0_r62 android-13.0.0_r63 android-13.0.0_r64 android-13.0.0_r65 android-13.0.0_r66 android-13.0.0_r67 android-13.0.0_r68 android-13.0.0_r69 android-13.0.0_r70 android-13.0.0_r71 android-13.0.0_r72 android-13.0.0_r73 android-13.0.0_r74 android-13.0.0_r75 android-13.0.0_r76 android-13.0.0_r77 android-13.0.0_r78 android-13.0.0_r79 android-13.0.0_r80 android-13.0.0_r81 android-13.0.0_r82 android-13.0.0_r83 android-u-beta-1-gpl t_frc_ase_330444010 t_frc_odp_330442000 t_frc_odp_330442040
  5. 785f867 Update glide dependencies to androidx am: 7d5ffbf62c am: 0aa3436fcd by Trevor Radcliffe · 2 years, 9 months ago

Glide

Build Status

Glide is a fast and efficient open source media management 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

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

Or use Gradle:

repositories {
  mavenCentral()
}

dependencies {
    compile 'com.github.bumptech.glide:glide:3.3.+'
    compile 'com.android.support:support-v4:19.1.0'
}

Or Maven:

<dependency>
  <groupId>com.github.bumptech.glide</groupId>
  <artifactId>glide</artifactId>
  <version>3.3.1</version>
  <type>aar</type>
</dependency>
<dependency>
  <groupId>com.google.android</groupId>
  <artifactId>support-v4</artifactId>
  <version>r7</version>
</dependency>

How do I use Glide?

Checkout the GitHub wiki for pages on a variety of topics, and see the javadocs.

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/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.with(myFragment) .load(url) .centerCrop() .placeholder(R.drawable.loading_spinner) .crossFade() .into(myImageView); return myImageView; }

Volley

Volley is now an optional dependency that can be included via a utility library. To use Volley to fetch media over http/https:

With Gradle:

dependencies {
    compile 'com.github.bumptech.glide:volley-integration:1.0.+'
    compile 'com.mcxiaoke.volley:library:1.0.+'
}

Or with Maven:

<dependency>
    <groupId>com.github.bumptech.glide</groupId>
    <artifactId>volley-integration</artifactId>
    <version>1.0.1</version>
    <type>jar</type>
</dependency>
<dependency>
    <groupId>com.mcxiaoke.volley</groupId>
    <artifactId>library</artifactId>
    <version>1.0.5</version>
    <type>aar</type>
</dependency>

Then in your Activity or Application, register the Volley based model loader:

public void onCreate() {
  Glide.get(this).register(GlideUrl.class, InputStream.class,
        new VolleyUrlLoader.Factory(yourRequestQueue));
  ...
}

After the call to register any requests using http or https will go through Volley.

OkHttp

In addition to Volley, Glide also includes support for fetching media using OkHttp. To use OkHttp to fetch media over http/https:

With Gradle:

dependencies {
    compile 'com.github.bumptech.glide:okhttp-integration:1.0.+'
    compile 'com.squareup.okhttp:okhttp:2.0.+'
}

Or with Maven:

<dependency>
    <groupId>com.github.bumptech.glide</groupId>
    <artifactId>okhttp-integration</artifactId>
    <version>1.0.1</version>
    <type>jar</type>
</dependency>
<dependency>
    <groupId>com.squareup.okhttp</groupId>
    <artifactId>okhttp</artifactId>
    <version>2.0.0</version>
    <type>jar</type>
</dependency>

Then in your Activity or Application, register the OkHttp based model loader:

public void onCreate() {
  Glide.get(this).register(GlideUrl.class, InputStream.class,
        new OkHttpUrlLoader.Factory(yourOkHttpClient));
  ...
}

Android SDK Version

Glide requires a minimum sdk version of 10.

License

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

Status

Version 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!

Build

Building Glide with gradle is fairly straight forward:

git clone git@github.com:bumptech/glide.git
cd glide
git submodule init && git submodule update
./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 setup the project and then:

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

Development

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

To open the project in Intellij 14:

  1. Go to File.
  2. Click on ‘Open...’
  3. Navigate to Glide's root directory.
  4. Select settings.gradle.

Getting Help

To report a specific problem or feature request, open a new issue on Github. For questions, suggestions, or anything else, join or email Glide's discussion group

Contributing

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

Thanks

Author

Sam Judd - @samajudd

Disclaimer

This is not an official Google product.