Android-Universal-Image-Loader 配置UIL配置
2015-11-13 17:35
561 查看
ImageLoaderConfiguration
在上面的示例代码中,我们使用ImageLoaderConfiguration的默认配置,下面给出ImageLoaderConfiguration比较详尽的配置,从下面的配置中,可以看出ImageLoaderConfiguration的配置主要是全局性的配置,主要有线程类、缓存大小、磁盘大小、图片下载与解析、日志方面的配置。
Display Options
每一个ImageLoader.displayImage(…)都可以使用Display Options。
原文链接:http://www.cnblogs.com/kissazi2/p/3886563.html
在上面的示例代码中,我们使用ImageLoaderConfiguration的默认配置,下面给出ImageLoaderConfiguration比较详尽的配置,从下面的配置中,可以看出ImageLoaderConfiguration的配置主要是全局性的配置,主要有线程类、缓存大小、磁盘大小、图片下载与解析、日志方面的配置。
ImageLoaderConfiguration config = new ImageLoaderConfiguration.Builder(context) .memoryCacheExtraOptions(480, 800) // default = device screen dimensions .diskCacheExtraOptions(480, 800, null) .taskExecutor(...) .taskExecutorForCachedImages(...) .threadPoolSize(3) // default .threadPriority(Thread.NORM_PRIORITY - 1) // default .tasksProcessingOrder(QueueProcessingType.FIFO) // default .denyCacheImageMultipleSizesInMemory() .memoryCache(new LruMemoryCache(2 * 1024 * 1024)) .memoryCacheSize(2 * 1024 * 1024) .memoryCacheSizePercentage(13) // default .diskCache(new UnlimitedDiscCache(cacheDir)) // default .diskCacheSize(50 * 1024 * 1024) .diskCacheFileCount(100) .diskCacheFileNameGenerator(new HashCodeFileNameGenerator()) // default .imageDownloader(new BaseImageDownloader(context)) // default .imageDecoder(new BaseImageDecoder()) // default .defaultDisplayImageOptions(DisplayImageOptions.createSimple()) // default .writeDebugLogs() .build();
Display Options
每一个ImageLoader.displayImage(…)都可以使用Display Options。
DisplayImageOptions options = new DisplayImageOptions.Builder() .showImageOnLoading(R.drawable.ic_stub) // resource or drawable .showImageForEmptyUri(R.drawable.ic_empty) // resource or drawable .showImageOnFail(R.drawable.ic_error) // resource or drawable .resetViewBeforeLoading(false) // default .delayBeforeLoading(1000) .cacheInMemory(false) // default .cacheOnDisk(false) // default .preProcessor(...) .postProcessor(...) .extraForDownloader(...) .considerExifParams(false) // default .imageScaleType(ImageScaleType.IN_SAMPLE_POWER_OF_2) // default .bitmapConfig(Bitmap.Config.ARGB_8888) // default .decodingOptions(...) .displayer(new SimpleBitmapDisplayer()) // default .handler(new Handler()) // default .build();
原文链接:http://www.cnblogs.com/kissazi2/p/3886563.html
相关文章推荐
- js实现图片加载时候逐渐出现的杂色效果
- 关于图片的预加载过程中隐藏未知的
- 【Apollo播放器】源码分析之图片加载模式
- Fresco学习初步
- UniversalImageLoader
- universal-image-loader 使用思路
- Android 框架练成 教你打造高效的图片加载框架
- VS2010自带报表控件(RDLC)加载图片相关
- Universal-Image-Loader中的线程池
- 从源代码分析Android-Universal-Image-Loader图片下载技巧
- UNIVERSAL IMAGE LOADER.PART 2---ImageLoaderConfiguration详解
- Android-Universal-Image-Loader的图片加载、显示流程
- UNIVERSAL IMAGE LOADER. PART 3---ImageLoader详解
- Android-Universal-Image-Loader三大组件DisplayImageOptions、ImageLoader、ImageLoaderConfiguration详解
- Glide图片加载变形如何解决?
- 我的第一篇博客--图片加载器
- Volley完全解析
- 通过JSON数据加载服务器端图片
- 图片加载框架Picasso的使用
- 为什么不推荐用UniversalImageLoader加载res/drawable