Clone this repo:
  1. 31e64ac am acf91e46: am ce1d390f: keep history after reset to ub-camera-haleakala by Alex Cheung · 2 years, 3 months ago master n-iot-preview-4 nougat-cts-release nougat-dev nougat-dr1-release nougat-mr0.5-release nougat-mr1-cts-release nougat-mr1-dev nougat-mr1-flounder-release nougat-mr1-release nougat-mr1-volantis-release nougat-mr1.1-release nougat-mr1.2-release nougat-mr1.3-release nougat-mr1.4-release nougat-mr1.5-release nougat-mr1.6-release nougat-mr2-dev nougat-mr2-pixel-release nougat-mr2-release nougat-mr2.1-release nougat-mr2.2-release nougat-mr2.3-release nougat-release o-iot-preview-5 o-preview sdk-release android-7.0.0_r1 android-7.0.0_r12 android-7.0.0_r13 android-7.0.0_r14 android-7.0.0_r15 android-7.0.0_r17 android-7.0.0_r19 android-7.0.0_r21 android-7.0.0_r24 android-7.0.0_r27 android-7.0.0_r28 android-7.0.0_r29 android-7.0.0_r3 android-7.0.0_r30 android-7.0.0_r31 android-7.0.0_r32 android-7.0.0_r33 android-7.0.0_r4 android-7.0.0_r5 android-7.0.0_r6 android-7.0.0_r7 android-7.1.0_r1 android-7.1.0_r2 android-7.1.0_r3 android-7.1.0_r4 android-7.1.0_r5 android-7.1.0_r6 android-7.1.0_r7 android-7.1.1_r1 android-7.1.1_r10 android-7.1.1_r11 android-7.1.1_r12 android-7.1.1_r13 android-7.1.1_r14 android-7.1.1_r15 android-7.1.1_r16 android-7.1.1_r17 android-7.1.1_r2 android-7.1.1_r20 android-7.1.1_r21 android-7.1.1_r22 android-7.1.1_r23 android-7.1.1_r24 android-7.1.1_r25 android-7.1.1_r26 android-7.1.1_r27 android-7.1.1_r28 android-7.1.1_r3 android-7.1.1_r31 android-7.1.1_r32 android-7.1.1_r33 android-7.1.1_r35 android-7.1.1_r38 android-7.1.1_r39 android-7.1.1_r4 android-7.1.1_r40 android-7.1.1_r41 android-7.1.1_r42 android-7.1.1_r43 android-7.1.1_r44 android-7.1.1_r45 android-7.1.1_r46 android-7.1.1_r47 android-7.1.1_r48 android-7.1.1_r49 android-7.1.1_r50 android-7.1.1_r6 android-7.1.1_r7 android-7.1.1_r8 android-7.1.1_r9 android-7.1.2_r1 android-7.1.2_r10 android-7.1.2_r11 android-7.1.2_r12 android-7.1.2_r13 android-7.1.2_r14 android-7.1.2_r15 android-7.1.2_r16 android-7.1.2_r17 android-7.1.2_r18 android-7.1.2_r19 android-7.1.2_r2 android-7.1.2_r23 android-7.1.2_r24 android-7.1.2_r25 android-7.1.2_r27 android-7.1.2_r28 android-7.1.2_r29 android-7.1.2_r3 android-7.1.2_r30 android-7.1.2_r32 android-7.1.2_r33 android-7.1.2_r4 android-7.1.2_r5 android-7.1.2_r6 android-7.1.2_r8 android-7.1.2_r9 android-cts-7.0_r1 android-cts-7.0_r10 android-cts-7.0_r11 android-cts-7.0_r12 android-cts-7.0_r2 android-cts-7.0_r3 android-cts-7.0_r4 android-cts-7.0_r5 android-cts-7.0_r6 android-cts-7.0_r7 android-cts-7.0_r8 android-cts-7.0_r9 android-cts-7.1_r1 android-cts-7.1_r2 android-cts-7.1_r3 android-cts-7.1_r4 android-cts-7.1_r5 android-cts-7.1_r6 android-cts-7.1_r7 android-cts-7.1_r8 android-n-iot-preview-4 android-n-mr1-preview-1 android-n-mr1-preview-2 android-n-mr2-preview-1 android-n-mr2-preview-2 android-o-iot-preview-5 android-o-preview-1 android-o-preview-2 android-o-preview-3 android-o-preview-4 android-wear-o-preview-3
  2. acf91e4 am ce1d390f: keep history after reset to ub-camera-haleakala by Alex Cheung · 2 years, 3 months ago n-iot-preview-2 nougat-mr1-wear-release android-n-iot-preview-2 android-n-preview-1 android-n-preview-2 android-n-preview-3 android-n-preview-4 android-n-preview-5 android-wear-7.1.1_r1 android-wear-n-preview-1 android-wear-n-preview-2
  3. 8dfd538 am 95e5bc58: keep history after reset to ub-camera-haleakala by Alex Cheung · 2 years, 3 months ago
  4. 95e5bc5 keep history after reset to ub-camera-haleakala by Alex Cheung · 2 years, 3 months ago
  5. b6872ab am 5fa77ef0: am b4b82b7e: am ac008b79: keep history after reset to ub-camera-haleakala by Alex Cheung · 2 years, 3 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.