设为首页 加入收藏

TOP

Fresco源码解析 - Hierarachy-View-Controller(二)
2015-11-21 01:04:39 来源: 作者: 【 】 浏览:7
Tags:Fresco 源码 解析 Hierarachy-View-Controller
ble. * @return top level drawable */ public Drawable getTopLevelDrawable(); }

DraweeController 也是一个接口,暴露了设置 hierarchy 和接收 Event 的方法。

void setHierarchy(@Nullable DraweeHierarchy hierarchy) public boolean onTouchEvent(MotionEvent event)
/**
 * Interface that represents a Drawee controller used by a DraweeView.
 * 

The view forwards events to the controller. The controller controls * its hierarchy based on those events. */ public interface DraweeController { /** Gets the hierarchy. */ @Nullable public DraweeHierarchy getHierarchy(); /** Sets a new hierarchy. */ void setHierarchy(@Nullable DraweeHierarchy hierarchy); /** * Called when the view containing the hierarchy is attached to a window * (either temporarily or permanently). */ public void onAttach(); /** * Called when the view containing the hierarchy is detached from a window * (either temporarily or permanently). */ public void onDetach(); /** * Called when the view containing the hierarchy receives a touch event. * @return true if the event was handled by the controller, false otherwise */ public boolean onTouchEvent(MotionEvent event); /** * For an animated image, returns an Animatable that lets clients control the animation. * @return animatable, or null if the image is not animated or not loaded yet */ public Animatable getAnimatable(); }


通过以上分析可以看出,DraweeControllerDraweeHierarchyDraweeView 三者共同构成了 Fresco 的三驾马车,下面的博文会各个击破,分析他们的实现原理和代码层次。

首页 上一页 1 2 下一页 尾页 2/2/2
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇二叉排序树(c++实现) 下一篇将Clob对象转换成String对象

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: