public class

RootDrawable

extends ForwardingDrawable
implements VisibilityAwareDrawable
java.lang.Object
   ↳ android.graphics.drawable.Drawable
     ↳ com.facebook.drawee.drawable.ForwardingDrawable
       ↳ com.facebook.drawee.generic.RootDrawable

Class Overview

The root drawable of a DraweeHierarchy.

Root drawable has several functions:

  • A hierarchy always has the same instance of a root drawable. That means that internal structural changes within the hierarchy don't require setting a new drawable to the view.
  • Root drawable prevents intrinsic dimensions to escape the hierarchy. This in turn prevents view to do any erroneous scaling based on those intrinsic dimensions, as the hierarchy is in charge of all the required scaling.
  • Root drawable is visibility aware. Visibility callback is used to attach the controller (if not already attached) when the hierarchy needs to be drawn. This prevents photo-not-loading issues in case attach event has not been called (for whatever reason). It also helps with memory management as the controller will get detached if the drawable is not visible.
  • Root drawable supports controller overlay, a special overlay set by the controller. Typical usages are debugging, diagnostics and other cases where controller-specific overlay is required.

Summary

[Expand]
Inherited Fields
From class com.facebook.drawee.drawable.ForwardingDrawable
Public Constructors
RootDrawable(Drawable drawable)
Public Methods
void draw(Canvas canvas)
int getIntrinsicHeight()
int getIntrinsicWidth()
void setControllerOverlay(Drawable controllerOverlay)
void setVisibilityCallback(VisibilityCallback visibilityCallback)
Sets a visibility callback.
boolean setVisible(boolean visible, boolean restart)
[Expand]
Inherited Methods
From class com.facebook.drawee.drawable.ForwardingDrawable
From class android.graphics.drawable.Drawable
From class java.lang.Object
From interface android.graphics.drawable.Drawable.Callback
From interface com.facebook.drawee.drawable.DrawableParent
From interface com.facebook.drawee.drawable.TransformAwareDrawable
From interface com.facebook.drawee.drawable.TransformCallback
From interface com.facebook.drawee.drawable.VisibilityAwareDrawable

Public Constructors

public RootDrawable (Drawable drawable)

Public Methods

public void draw (Canvas canvas)

public int getIntrinsicHeight ()

public int getIntrinsicWidth ()

public void setControllerOverlay (Drawable controllerOverlay)

public void setVisibilityCallback (VisibilityCallback visibilityCallback)

Sets a visibility callback.

Parameters
visibilityCallback the visibility callback to be set

public boolean setVisible (boolean visible, boolean restart)