自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(76)
  • 收藏
  • 关注

原创 xUtils源码阅读(8)-ImageDecoder

图片解析工具类,就是从文件读取图片内容,并处理成我们需要的样式(大小,旋转,修剪等)。该工具类别看这么的长,实际上就一个函数,那就是decodeFileWithLock所有其它的函数都是在为这个函数做服务呢,或者给这个函数做帮手呢。这样再来看该类,就简单多了。源码:/** * Created by wyouflf on 15/10/9. * ImageDecoder

2016-09-20 16:40:32 979

原创 xUtils源码阅读(7)-GitDrawable

通常情况下,ImageView是不支持Gif动画的,所以我们要向支持Gif的话,必须自己来处理。在这里我们就不是对Drawable的包装了,我们是对Drawable的重新实现。同时由于Gif具有动画,所以又同时实现了Runnable,Animatable接口。源码:public class GifDrawable extends Drawable implements Runn

2016-09-20 11:00:04 332

原创 xUtils源码阅读(6)-AsyncDrawable

AsyncDrawable,异步图片。源码:/** * Author: wyouflf * Date: 13-11-17 * Time: 上午11:42 */public final class AsyncDrawable extends Drawable { private final WeakReference imageLoaderRefere

2016-09-19 16:55:16 510

原创 xUtils源码阅读(5)-ReuseableBitmapDrawable

ReuseableBitmapDrawable类在BitmapDrawable基础上增加了ReusableDrawable接口的实现。ReusableDrawable接口的定义如下:/** * Created by wyouflf on 15/10/20. * 使已被LruCache移除, 但还在被ImageView使用的Drawable可以再次被回收使用. */

2016-09-19 16:47:10 443

原创 xUtils源码阅读(4)-MemCacheKey

该类通过图片的url和显示参数,生成hashcode以供使用。功能简单,单一。源码:/** * Created by wyouflf on 15/10/20. *//*package*/ final class MemCacheKey { public final String url; public final ImageOptions options;

2016-09-19 16:21:15 212

原创 xUtils源码阅读(3)-ImageManagerImpl

ImageManager的实现类。源码:/** * Created by wyouflf on 15/10/9. */public final class ImageManagerImpl implements ImageManager { private static final Object lock = new Object(); private st

2016-09-19 15:08:04 352

原创 xUtils源码阅读(2)-ImageManager

选择图片管理作为切入点。这是一个彻底的接口定义,从其定义,可以猜测其功能。源码:/** * Created by wyouflf on 15/6/17. * 图片绑定接口 */public interface ImageManager { void bind(ImageView view, String url);//url指向的图片显示在view上

2016-09-19 14:40:11 215

原创 xUtils源码阅读(1)- x

这次阅读xUtils我们从上到下的方式读。先看看这个这么另类的类x吧。很简单,就是对整个项目的一个整体功能的总括。源码:/** * Created by wyouflf on 15/6/10. * 任务控制中心, http, image, db, view注入等接口的入口. * 需要在在application的onCreate中初始化: x.Ext.init(this

2016-09-19 14:30:24 2019 1

原创 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 339

原创 Universal-Image-Loader源码阅读(40)-ImageLoaderConfiguration

作为ImageLoader的配置文件存在。因为ImageLoader的需要关注的地方有memory缓存,disc缓存,任务处理,图片加载,图片解析,图片展示。所以配置也就是准对这些地方的配置。源码:/** * Presents configuration for {@link ImageLoader} * * @author Sergey Tarasevich (no

2016-09-06 14:16:34 283

原创 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 367

原创 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 165

原创 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 236

原创 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 726

原创 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 316

原创 Universal-Image-Loader源码阅读(35)-

前边看了那么多的文件,终于转到核心了!!整个的ImageLoader的运行都是异步的,那么异步执行的心脏就在这里了!源码:/** * {@link ImageLoader} engine which responsible for {@linkplain LoadAndDisplayImageTask display task} execution. * * @author Se

2016-08-31 14:11:06 228

原创 Universal-Image-Loader源码阅读(34)-ImageDecoder

看名字翻译成图像解析器。就一个功能接口,就是跟据图片信息,解析出Bitmap来源码:/** * Provide decoding image to result {@link Bitmap}. * * @author Sergey Tarasevich (nostra13[at]gmail[dot]com) * @see ImageDecodingInfo * @since

2016-08-30 14:31:49 254

原创 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 496

原创 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 289

原创 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 390

原创 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 331

原创 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 313

原创 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 386

原创 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 416

原创 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 323

原创 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 238

原创 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 257

原创 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 388

原创 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 299

原创 Universal-Image-Loader源码阅读(21)-memory总结

已经把 memory下的代码读完了,我们也都有了个大致的了解,以后在遇到类似的问题,大可以把他们统统的拿来自己用。下面看看他们之间的关系吧:

2016-08-24 16:11:36 151

原创 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 326

原创 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 169

原创 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 191

原创 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 178

原创 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 198

原创 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 184

原创 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 187

原创 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 168

原创 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 151

原创 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 162

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除