+0
日增长
16,787
stars
5,988
forks
1,313
watchers
153
prs
1,230
issues
0
releases
README
!Logo Universal Image Loader
The great ancestor of modern image-loading libraries :)
UIL aims to provide a powerful, flexible and highly customizable instrument for image loading, caching and displaying. It provides a lot of configuration options and good control over the image loading and caching process.
!Screenshot
Project News
Really have no time for development... so I stop project maintaining since Nov 27 :(
UIL [27.11.2011 - 27.11.2015]
Thanks to all developers for your support :)
Features
Multi-thread image loading (async or sync)
Wide customization of ImageLoader's configuration (thread executors, downloader, decoder, memory and disk cache, display image options, etc.)
Many customization options for every display image call (stub images, caching switch, decoding options, Bitmap processing and displaying, etc.)
Image caching in memory and/or on disk (device's file system or SD card)
Listening loading process (including downloading progress)
Android 4.1+ support
Downloads
universal-image-loader-1.9.5.jar
Documentation
Quick Setup
Configuration
Display Options
Useful Info - Read it before asking a question
User Support - Read it before creating new issue
Sample project - Learn it to understand the right way of library usage
ChangeLog - Info about API changes is here
Usage
Dependency
implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
Acceptable URIs examples
java
"http://site.com/image.png" // from Web
"file:///mnt/sdcard/image.png" // from SD card
"file:///mnt/sdcard/video.mp4" // from SD card (video thumbnail)
"content://media/external/images/media/13" // from content provider
"content://media/external/video/media/13" // from content provider (video thumbnail)
"assets://image.png" // from assets
"drawable://" + R.drawable.img // from drawables (non-9patch images)
NOTE: Use drawable:// only if you really need it! Always consider the native way to load drawables - ImageView.setImageResource(...) instead of using of ImageLoader.
Simple
java
ImageLoader imageLoader = ImageLoader.getInstance(); // Get singleton instance
java
// Load image, decode it to Bitmap and display Bitmap in ImageView (or any other view
// which implements ImageAware interface)
imageLoader.displayImage(imageUri, imageView);
java
// Load image, decode it to Bitmap and return Bitmap to callback
imageLoader.loadImage(imageUri, new SimpleImageLoadingListener() {
@Override
public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) {
// Do whatever you want with Bitmap
}
});
java
// Load image, decode it to Bitmap and return Bitmap synchronously
Bitmap bmp = imageLoader.loadImageSync(imageUri);
Complete
java
// Load image, decode it to Bitmap and display Bitmap in ImageView (or any other view
// which implements ImageAware interface)
imageLoader.displayImage(imageUri, imageView, options, new ImageLoadingListener() {
@Override
public void onLoadinTop issues
#559EXIF Orientation bug37 comments · 2014-03-04#376Image flickering on notifyDataSetChanged()36 comments · 2013-08-20#699Loading image from external storage(gallery/camera)13 comments · 2014-07-21#850Dynamic URL when use UIL12 comments · 2014-12-18#313Problem with first image of a listview (Version 1.8.4).12 comments · 2013-06-16#1086Javadoc generation failed. Generated Javadoc options11 comments · 2015-09-15#778"Cache is closed"11 comments · 2014-10-15#131Image preloading with low priority11 comments · 2012-12-31