图片加载框架 KImageLoader

码农软件 · 软件分类 · Android UI 组件 · 2019-04-24 08:57:27

软件介绍

KImageLoader,具有某些新特性的图片加载框架

运行效果:

特点

  • 同时为多个ImageView加载同一张图片

  • 指定图片加载来源

  • 指定图片加载质量

  • 指定是否需要缓存到内存中或者磁盘中

  • 设置图片加载任务优先级

  • 监听图片加载过程

用法

imageLoader = ImageLoader.getInstance();
        ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder()
                        .setDiskCacheMaxSize(2 * 1024 * 1024 * 1024L) //指定最大磁盘缓存为2GB
                        .setDiskCachePath("/sdcard/KImageLoader") //指定磁盘缓存目录
                        .isAutoCreateCacheDir(true) //如果磁盘缓存目录不存在自动创建
                        .setMemoryCacheManager(null) //指定内存缓存管理器
                        .setDiskCacheManager(null)   //指定磁盘缓存管理器
                        .setDownloader(null)         //指定网络下载器
                        .build();
        imageLoader.setImageLoaderConfiguration(config);
        ImageLoaderOptions opts = new ImageLoaderOptions.Builder()
                .cacheInMemory(true) //允许缓存到内存缓存中
                .cacheInDisk(true)   //允许缓存到磁盘缓存中
                .setLoadingDrawableId(R.drawable.ic_launcher) //加载图片过程中显示的图片
                .setLoadedfailDrawableId(R.drawable.image_emoticon10) //加载失败时显示的图片
                .loadFromMemory(true) //允许从内存缓存中加载
                .loadFromDisk(true)   //允许从磁盘缓存中加载
                .loadFromNetwork(true) //允许从网络上加载
                .setBitmapOptions(null) //指定加载的图片质量
                .build();
        String url = "http://img2.imgtn.bdimg.com/it/u=2702123953,998736265&fm=21&gp=0.jpg";
        ImageView imageView = (ImageView) findViewById(R.id.iv);
        imageLoader.displayImage(getApplicationContext(), url, imageView, opts);

本文地址:https://codercto.com/soft/d/4264.html

The Algorithm Design Manual

The Algorithm Design Manual

Steven S Skiena / Springer / 2011-11-14 / GBP 55.07

....The most comprehensive guide to designing practical and efficient algorithms.... Written by a well-known algorithms researcher who received the IEEE Computer Science and Engineering Teaching Aw......一起来看看 《The Algorithm Design Manual》 这本书的介绍吧!

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试

RGB HSV 转换
RGB HSV 转换

RGB HSV 互转工具