
Universal-Image-Loader阅读
文章平均质量分 78
wbzwind
这个作者很懒,什么都没留下…
展开
-
Universal-Image-Loader源码阅读(41)-ImageLoader
我们的入口。别看这个函数这么的长,其实需要关注的就几个函数而已,大部分的代码量都是注释,以及核心函数的不同表现形式。源码:/** * Singletone for image loading and displaying at {@link ImageView ImageViews} * NOTE: {@link #init(ImageLoaderConfiguration原创 2016-09-06 14:45:57 · 378 阅读 · 0 评论 -
Universal_image-Loader源码阅读(22)-disc/DiskCache
看完了MemoryCache,接下来看DiscCache.硬件中的缓存文件管理。源码:/** * Interface for disk cache * * @author Sergey Tarasevich (nostra13[at]gmail[dot]com) * @since 1.9.2 */public interface DiskCache { /**原创 2016-08-24 16:32:57 · 326 阅读 · 0 评论 -
Universal-Image-Loader源码阅读(21)-memory总结
已经把 memory下的代码读完了,我们也都有了个大致的了解,以后在遇到类似的问题,大可以把他们统统的拿来自己用。下面看看他们之间的关系吧:原创 2016-08-24 16:11:36 · 180 阅读 · 0 评论 -
Universal-Image-Loader源码阅读(20)-memory/impl/LRULimitedMemoryCache
采用了LRU策略的LimitedMemoryCache源码:/** * Limited {@link Bitmap bitmap} cache. Provides {@link Bitmap bitmaps} storing. Size of all stored bitmaps will not to * exceed size limit. When cache reach原创 2016-08-24 16:05:22 · 355 阅读 · 0 评论 -
Universal-Image-Loader源码阅读(19)-memory/impl/LargestLimitedMemoryCache
在LimitedMemoryCache的基础上,当超过缓存上限的时候,将内存中最大的图片删掉。源码:/** * Limited {@link Bitmap bitmap} cache. Provides {@link Bitmap bitmaps} storing. Size of all stored bitmaps will not to * exceed size lim原创 2016-08-24 14:42:20 · 190 阅读 · 0 评论 -
Universal-Image-Loader源码阅读(18)-memory/impl/FIFOLimitedMemoryCache
在原来LimitedMemoryCache的基础上,扩展了FIFO的策略进行图片的缓存策略。源码:/** * Limited {@link Bitmap bitmap} cache. Provides {@link Bitmap bitmaps} storing. Size of all stored bitmaps will not to * exceed size原创 2016-08-24 13:54:04 · 226 阅读 · 0 评论 -
Universal-Image-Loader源码阅读(17)-memory/impl/LimitedAgeMemoryCache
依然是包装类,包装类最长老化时间。源码:/** * Decorator for {@link MemoryCache}. Provides special feature for cache: if some cached object age exceeds defined * value then this object will be removed from c原创 2016-08-24 13:49:59 · 204 阅读 · 0 评论 -
Universal-Image-Loader源码阅读(16)-memory/impl/FuzzyKeyMemoryCache
看名字,可以翻译成模糊关键字的缓存。看代码,是memoryCache的包装类,增加了key值(字符串)的比较。可以对其它MemoryCache,增加自定义的字符串比较算法。源码:/** * Decorator for {@link MemoryCache}. Provides special feature for cache: some different keys a原创 2016-08-24 13:43:04 · 232 阅读 · 0 评论 -
Universal-Image-Loader源码阅读(15)-memory/impl/LruMemoryCache
采用LRU算法处理缓存,缓存采用普通的引用(强引用),采用固定的图片数量,每次只能有一个图片被访问。同时,由于采用的是LRU算法,所以,缓存中的图片是有可能被删除回收的。源码:/** * A cache that holds strong references to a limited number of Bitmaps. Each time a Bitmap is acce原创 2016-08-24 11:25:33 · 214 阅读 · 0 评论 -
Universal-Image-Loader源码阅读(23)--BaseDiskCache
Discache的抽象实现。源码:/** * Base disk cache. * * @author Sergey Tarasevich (nostra13[at]gmail[dot]com) * @see FileNameGenerator * @since 1.0.0 */public abstract class BaseDiskCache implement原创 2016-08-25 13:52:10 · 419 阅读 · 0 评论 -
Universal-Image-Loader源码阅读(24)-LimitedAgeDiskCache
有时间限制的硬件缓存。增加了文件存在的最长时间,超过时间了则删除。但是存储空间的额大小没有限制。源码/** * Cache which deletes files which were loaded more than defined time. Cache size is unlimited. * * @author Sergey Tarasevich (nostra13[at原创 2016-08-25 14:56:43 · 286 阅读 · 0 评论 -
Universal-Image-Loader源码阅读(25)-UnlimitedDiskCache
不限制的硬件缓存。这个就是直接的实现了,没有添加什么限制,规则。有就有,没就没。源码:/** * Default implementation of {@linkplain com.nostra13.universalimageloader.cache.disc.DiskCache disk cache}. * Cache size is unlimited. *原创 2016-08-25 15:30:21 · 267 阅读 · 0 评论 -
Universal-Image-Loader源码阅读(4)-utils/ImageSizeUtils
该工具类继承了L,IoUtils的特点。不过要相对代码量大了一点了。该工具类是用于计算图片大小的。源码:/** * Provides calculations with image sizes, scales * * @author Sergey Tarasevich (nostra13[at]gmail[dot]com) * @since 1.8.3 */publ原创 2016-08-15 11:10:00 · 332 阅读 · 0 评论 -
Universal-Image-Loader源码阅读(3)-utils/IoUtils
该类从名字看就是IO工具类。同样类声明为final,构造为private,方法都是static。这些是工具类的标配呀!源码:/** * Provides I/O operations * * @author Sergey Tarasevich (nostra13[at]gmail[dot]com) * @since 1.0.0 */public final原创 2016-08-15 10:53:12 · 214 阅读 · 0 评论 -
Universal-Image-Loader源码阅读(1)-开篇
作为第二个阅读的开源代码,我选择了Universal-Image-Loader这个要比EventBus更加具有复杂性,并且代码量也更大,而且使用的很普遍,大家都比较熟悉。作为开篇,我还会采用从简入难的方法蚕食代码。没有什么好说的,下篇开始吧!原创 2016-08-15 10:42:17 · 223 阅读 · 0 评论 -
Universal-Image-Loader源码阅读(2)-utils/L
先捡简单的捏一捏呵呵工具类一般都具有通用性,以及简单的特点,所以选择工具类作为切入点,好像并不能切入主题,不过可以打扫一下周边的障碍,同时熟悉一下套路。该类为静态工具类,方法都是静态方法,构造函数为private,类声明为final这些我们都可以学习的,以后我们自己写工具类的时候也要参考。源码:/** * "Less-word" analog of And原创 2016-08-15 10:43:36 · 254 阅读 · 0 评论 -
Universal-Image-Loader源码阅读(40)-ImageLoaderConfiguration
作为ImageLoader的配置文件存在。因为ImageLoader的需要关注的地方有memory缓存,disc缓存,任务处理,图片加载,图片解析,图片展示。所以配置也就是准对这些地方的配置。源码:/** * Presents configuration for {@link ImageLoader} * * @author Sergey Tarasevich (no原创 2016-09-06 14:16:34 · 325 阅读 · 0 评论 -
Universal-Image-Loader源码阅读(39)-DefaultConfigurationFactory
专门用于创建一些默认配置选项的工具类。源码:/** * Factory for providing of default options for {@linkplain ImageLoaderConfiguration configuration} * * @author Sergey Tarasevich (nostra13[at]gmail[dot]com) * @si原创 2016-09-06 11:04:54 · 399 阅读 · 0 评论 -
Universal-Image-Loader源码阅读(38)-ImageLoaderEngine
源码:/** * {@link ImageLoader} engine which responsible for {@linkplain LoadAndDisplayImageTask display task} execution. * * @author Sergey Tarasevich (nostra13[at]gmail[dot]com) * @since 1.7.1 *原创 2016-09-05 11:28:27 · 199 阅读 · 0 评论 -
Universal-Image-Loader源码阅读(37)-ProcessAndDisplayImageTask
增加了在展示图片过程中的中间过程。计算出一个中间的图片,然后displey到view中。核心依然是LoadAndDisplayImageTask 源码:/** * Presents process'n'display image task. Processes image {@linkplain Bitmap} and display it in {@link ImageV原创 2016-09-05 11:06:40 · 265 阅读 · 0 评论 -
Universal-Image-Loader源码阅读(14)-memory/impl/WeakMemoryCache
该类作为memorycache的实现类,它实现了 baseMemoryCache的抽想方法。该实现类,仅实现了弱引用的缓存。源码:/** * Memory cache with {@linkplain WeakReference weak references} to {@linkplain android.graphics.Bitmap bitmaps} * * NO原创 2016-08-24 11:16:19 · 222 阅读 · 0 评论 -
Universal-Image-Loader源码阅读(13)-cache/LimitedMemoryCache
在baseMemoryCache的基础上,继续定义了缓存图片的大小限制,以及最大的空间的限制。看名字,是有限制的缓存。并且增加了 硬链接的缓存源码:/** * Limited cache. Provides object storing. Size of all stored bitmaps will not to exceed size limit ( * {@lin原创 2016-08-22 16:40:15 · 197 阅读 · 0 评论 -
Universal-Image-Loader源码阅读(30)-CircleBitmapDisplayer
展示圆形图片。把原始图片剪切成圆形图片进行展示。就是把图片转变成原型图片画在展示器中(ImageAware)。源码:/** * Can display bitmap cropped by a circle. This implementation works only with ImageViews wrapped * in ImageViewAware. * * If th原创 2016-08-29 17:07:39 · 361 阅读 · 0 评论 -
Universal-Image-Loader源码阅读(29)-SimpleBitmapDisplayer
BitmapDisplayer的最简单地实现。源码:/** * Just displays {@link Bitmap} in {@link com.nostra13.universalimageloader.core.imageaware.ImageAware} * * @author Sergey Tarasevich (nostra13[at]gmail[dot]com) *原创 2016-08-29 17:05:58 · 340 阅读 · 0 评论 -
Universal-Image-Loader源码阅读(29)-BitmapDisplayer
在控件上展示图片的接口定义。源码:/** * Displays {@link Bitmap} in {@link com.nostra13.universalimageloader.core.imageaware.ImageAware}. Implementations can * apply some changes to Bitmap or any animation fo原创 2016-08-29 17:03:38 · 418 阅读 · 0 评论 -
Universal-Image-Loader源码阅读(29)-BaseImageDownloader
ImageDownLoader的具体实现。源码:/** * Provides retrieving of {@link InputStream} of image by URI from network or file system or app resources. * {@link URLConnection} is used to retrieve image strea原创 2016-08-29 16:28:35 · 449 阅读 · 0 评论 -
Universal-Image-Loader源码阅读(28)-ImageDownloader
图片加载接口。源码:/** * Provides retrieving of {@link InputStream} of image by URI. * Implementations have to be thread-safe. * * @author Sergey Tarasevich (nostra13[at]gmail[dot]com) * @since 1.原创 2016-08-29 16:22:04 · 361 阅读 · 0 评论 -
Universal-Image-Loader源码阅读(8)-core/imageaware/NonViewAware
imageaware的空实现,即没有包装任何view,用来显示图片。看注释,它的用途是用来处理图片的相关信息的,但不用来显示图片。即用在下载解析图片的但又不用显示的场景。源码:/** * ImageAware which provides needed info for processing of original image but do nothing for dis原创 2016-08-15 17:03:51 · 429 阅读 · 0 评论 -
Universal-Image-Loader源码阅读(7)-core/imageaware/ImageViewAware
ImageAware的具体实现。对ImageView的包装。源码:/** * Wrapper for Android {@link android.widget.ImageView ImageView}. Keeps weak reference of ImageView to prevent memory * leaks. * * @author Sergey Tar原创 2016-08-15 16:58:24 · 222 阅读 · 0 评论 -
Universal-Image-Loader源码阅读(6)-core/imageaware/ViewAware
ImageArare的抽象类实现源码:/** * Wrapper for Android {@link android.view.View View}. Keeps weak reference of View to prevent memory leaks. * * @author Sergey Tarasevich (nostra13[at]gmail[dot]com)原创 2016-08-15 16:47:58 · 235 阅读 · 0 评论 -
Universal-Image-Loader源码阅读(31)-FadeInBitmapDisplayer
带有闪入动画的displayer。读完之后,恍然大悟,原来就是在设置了图片之后,给其增加了从淡到浓的动画。源码:/** * Displays image with "fade in" animation * * @author Sergey Tarasevich (nostra13[at]gmail[dot]com), Daniel Martí * @since 1.6原创 2016-08-30 09:51:22 · 431 阅读 · 0 评论 -
Universal-Image-Loader源码阅读(32)-RoundedBitmapDisplayer
图片圆角展示。核心就是理解图片渲染。源码:/** * Can display bitmap with rounded corners. This implementation works only with ImageViews wrapped * in ImageViewAware. * * This implementation is inspired by *原创 2016-08-30 13:43:12 · 321 阅读 · 0 评论 -
Universal-Image-Loader源码阅读(33)-RoundedVignetteBitmapDisplayer
圆角并且有影晕效果。其实还是在修改渲染效果,如果你对渲染深有研究的话,完全可以自己写出几个好玩的渲染出来,然后应用到这里。源码:/** * Can display bitmap with rounded corners and vignette effect. This implementation works only with ImageViews wrapped * in I原创 2016-08-30 14:25:35 · 533 阅读 · 0 评论 -
Universal-Image-Loader源码阅读(12)-cache/BaseMemoryCache
作为MemoryCache的第一个实现的抽象类,它主要的共鞥是定义了基本的存储方式--采用弱引用的方法,并且支持多线程的。源码:/** * Base memory cache. Implements common functionality for memory cache. Provides object references ( * {@linkplain Referenc原创 2016-08-22 16:20:17 · 185 阅读 · 0 评论 -
Universal-Image-loader源码阅读(11)-catche/MemoryCache
上一节涉及到了memorycatche,那么现在我们就看看MemoryCatche是如何实现的。源码:/** * Interface for memory cache * * @author Sergey Tarasevich (nostra13[at]gmail[dot]com) * @since 1.9.2 */public interface MemoryCach原创 2016-08-22 16:18:27 · 186 阅读 · 0 评论 -
Universal-Image-Loader源码阅读(10)-utils/MemoryCacheUtils
图片内存key的生成工具类,用于生成图片的key值。依据图片的地址(uri),以及图片的大小(imageSize)主要功能包括图片的查找,图片的比较,图片key的生成相对功能简单。源码:/** * Utility for generating of keys for memory cache, key comparing and other work with mem原创 2016-08-22 15:36:30 · 298 阅读 · 0 评论 -
Universal-Image-Loader源码阅读(9)-utils/StorageUtils
硬件存储工具类也就是管理我们的缓存文件在手机硬件上存储的位置如果我们以后要做本地缓存文件的话,可以直接拷贝该文件,简单的修改一下目录名称,即可。源码:/** * Provides application storage paths * * @author Sergey Tarasevich (nostra13[at]gmail[dot]com) * @since 1.0.0原创 2016-08-15 17:12:19 · 338 阅读 · 0 评论 -
Universal-Image-Loader源码阅读(36)-LoadAndDisplayImageTask
加载并展示图片任务。顾名思义,就是先要把图片加载到内存中来,然后再view中显示。源码:/** * Presents load'n'display image task. Used to load image from Internet or file system, decode it to {@link Bitmap}, and * display it in {@link c原创 2016-08-31 14:44:25 · 765 阅读 · 0 评论 -
Universal-Image-Loader源码阅读(36)-DisplayBitmapTask
显示图片任务。改种任务,直接显示图片,不需要先加载(已经加载过了)。源码:/** * Displays bitmap in {@link com.nostra13.universalimageloader.core.imageaware.ImageAware}. Must be called on UI thread. * * @author Sergey Tarasevich原创 2016-08-31 14:34:00 · 353 阅读 · 0 评论 -
Universal-Image-Loader源码阅读(35)-
前边看了那么多的文件,终于转到核心了!!整个的ImageLoader的运行都是异步的,那么异步执行的心脏就在这里了!源码:/** * {@link ImageLoader} engine which responsible for {@linkplain LoadAndDisplayImageTask display task} execution. * * @author Se原创 2016-08-31 14:11:06 · 261 阅读 · 0 评论