使用架包实现android异步加载图片
16lz
2021-12-04
网上有很多关于android异步加载图片的文章,这些文章主要实现了加载图片功能,但没有做图片等的缓存操作,易发生一些不可预知的错误,现在先辈们已经做好了一个关于android异步加载图片的架包,使用方法如下
android网络图片异步加载(使用架包)
FinalBitmap fb=FinalBitmap.create(this);//this为contextfb.display(imageView, uri);
架包下载地址:http://pan.baidu.com/s/1eQ9SRV8
如果需要添加加载和加载失败的默认图片时
public BitmapDisplayConfig config;config = new BitmapDisplayConfig();Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.defaultimg);config.setLoadingBitmap(bitmap);//加载时的图片config.setLoadfailBitmap(bitmap);//加载失败时的图片config.setAnimationType(BitmapDisplayConfig.AnimationType.fadeIn);config.setAnimation(null);config.setBitmapWidth(220);config.setBitmapHeight(320);fb.display(playrecord_img, playRecordList.get(j).getVideoImgUrl(), config);//调用的是重载方法
更多相关文章
- Android加载Gif和ImageView的通用解决方案:android-gif-drawable:G
- android实现自定义相机以及图片的水印
- Android使用BitmapFactory.Options解决加载大图片内存溢出问题
- android的selector背景选择器
- Android中几种图像特效处理
- Android进程注入
- android热修复技术 HotFix
- Android应用程序资源——Drawable资源概述
- 浅谈android的selector背景选择器