Fresco源码之DraweeHierachy
来源:互联网 发布:淘宝上远程降级可靠吗 编辑:程序博客网 时间:2024/04/29 01:52
DraweeHierachy源码查看
看DraweeHierachy源码之前,我们先看一下DraweeHierachy的继承体系
DraweeHierachy (I)
–| SettableDraweeHierarchy (I)
——| GenericDraweeHierarchy
GenericDraweeHierarchy
GenericDraweeHierarchy是一个顶级接口,只有获取顶层的Drawable方法getTopLevelDrawable
public interface DraweeHierarchy { /** * Returns the top level drawable in the corresponding hierarchy. Hierarchy should always have * the same instance of its top level drawable. * @return top level drawable */ Drawable getTopLevelDrawable();}
SettableDraweeHierarchy
SettableDraweeHierarchy继承与DraweeHierachy,也是一个接口:
用于获取顶层的drawable
图像可以被重置
图像可以设置进度
设置失败
设置重试
设置controllerOverlay
/** * Called by controller when the hierarchy should be reset to its initial state. Any image * previously set by {@code setImage} should be detached and not used anymore. */ void reset(); /** * Called by controller when the future that provides the actual image completes successfully. * Hierarchy should display the actual image. * @param drawable drawable to be set as the temporary image * @param progress number in range [0, 1] that indicates progress * @param immediate if true, image will be shown immediately (without fade effect) */ void setImage(Drawable drawable, float progress, boolean immediate); /** * Called by controller to update the progress. * Hierarchy can choose to hide the progressbar when progress is set to its final value of 1. * @param progress number in range [0, 1] that indicates progress * @param immediate if true, progressbar will be shown/hidden immediately (without fade effect) */ void setProgress(float progress, boolean immediate); /** * Called by controller when the future that provides the actual image completes with failure. * Hierarchy can choose to display between different images based on cause of failure. * @param throwable cause of failure */ void setFailure(Throwable throwable); /** * Called by controller when the future that provides the actual image completes with failure, * but the controller is prepared to kick off a retry when the user clicks on the image. * Hierarchy can choose to display a retry image. * @param throwable cause of failure */ void setRetry(Throwable throwable); /** * Called by controller if it needs to display some controller overlay. * @param drawable drawable to be displayed as controller overlay */ void setControllerOverlay(Drawable drawable);
GenericDraweeHierarchy
GenericDraweeHierarchy是SettableDraweeHierarchy的实现类,用来实现:
图像可以被重置
图像可以设置进度
设置失败
设置重试
设置controllerOverlay
这里就不再赘述。
0 0
- Fresco源码之DraweeHierachy
- Fresco之DraweeHierachy和DraweeController
- Fresco 源码分析(一) DraweeView-DraweeHierarchy-DraweeController(MVC) DraweeHierachy+DraweeController的分析
- Fresco源码之DraweeController
- 源码分析之Fresco
- Fresco源码分析之DraweeView
- Fresco源码分析之Hierarchy
- Fresco源码之Drawees-MVC设计
- Fresco源码赏析 之 基本流程
- Fresco源码赏析 之 图片显示流程
- Fresco源码解析 - DraweeView
- Fresco 源码分析(序)
- Fresco 源码浅析
- Fresco源码分析
- Fresco源码分析
- Fresco源码解析 - 本地编译
- fresco源码分析-内存回收
- Fresco之初识
- PE文件结构解析
- mysqldump 用法
- 游太平记
- HDU 1234 开门人和关门人(模拟水题)
- [转转]反调试技巧总结-原理和实现-----转
- Fresco源码之DraweeHierachy
- C++ 使用smtp协议发送邮件的简单实现
- 关于数字签名的应用
- 机房水题欢乐赛 2016-04-23 下午
- 如何使用google搜索
- zoj 3938 Defuse the Bomb
- 面试的一些总结
- python带tkinter窗口的ftp服务器
- Atom编辑器入门到精通(五) Git支持