android 图片双缓存,开源框架 universali image loader

最近做android的图片双缓存发现了一个开源框架,觉得很好用,在这里记录一下,留着备用。

if you want to get a rounded bitmap ,  you can use this: new RoundedBitmapDisplayer(20);

example:

ImageLoader imageLoader = ImageLoader.getInstance(); 


DisplayImageOptions  options = new DisplayImageOptions.Builder() 
.showStubImage(R.drawable.ic_stub) 
.showImageForEmptyUri(R.drawable.ic_empty) 
.showImageOnFail(R.drawable.ic_error) 
.cacheInMemory(true) 
.cacheOnDisc(true) 
.displayer(new RoundedBitmapDisplayer(20)) 
.build(); 



imageLoader.displayImage(imageUrls[position], holder.image, options, null);

https://github.com/nostra13/Android-Universal-Image-Loader

相关推荐