Back to Fresco

RootDrawable

docs/javadoc/reference/com/facebook/drawee/generic/RootDrawable.html

3.6.024.0 KB
Original Source

Fresco

|

|

Packages | Classes

Classes

Enums

Packages | Classes

Summary: Inherited Fields | Ctors | Methods | Inherited Methods | [Expand All]

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

| protected TransformCallback | mTransformCallback | |

|

Public Constructors
Public Methods
void
int
int
void
void
Sets a visibility callback.
boolean

| [Expand] Inherited Methods | | --- | | From class com.facebook.drawee.drawable.ForwardingDrawable

| void | draw(Canvas canvas) | | Drawable.ConstantState | getConstantState() | | Drawable | getCurrent() | | Drawable | getDrawable() Gets the child drawable. | | int | getIntrinsicHeight() | | int | getIntrinsicWidth() | | int | getOpacity() | | boolean | getPadding(Rect padding) | | void | getParentTransform(Matrix transform) | | void | getRootBounds(RectF bounds) Called when the drawable needs to get its root bounds. | | void | getTransform(Matrix transform) Called when the drawable needs to get all matrices applied to it. | | void | getTransformedBounds(RectF outBounds) Gets the transformed bounds of this drawable. | | void | invalidateDrawable(Drawable who) | | boolean | isStateful() | | Drawable | mutate() | | void | onBoundsChange(Rect bounds) | | boolean | onLevelChange(int level) | | boolean | onStateChange(int[] state) | | void | scheduleDrawable(Drawable who, Runnable what, long when) | | void | setAlpha(int alpha) | | void | setColorFilter(ColorFilter colorFilter) | | Drawable | setCurrent(Drawable newDelegate) Sets a new drawable to be the delegate, and returns the old one (or null). | | Drawable | setCurrentWithoutInvalidate(Drawable newDelegate) As setCurrent, but without invalidating a drawable. | | void | setDither(boolean dither) | | Drawable | setDrawable(Drawable newDrawable) Sets the new child drawable. | | void | setFilterBitmap(boolean filterBitmap) | | void | setHotspot(float x, float y) | | void | setTransformCallback(TransformCallback transformCallback) Sets a transform callback. | | boolean | setVisible(boolean visible, boolean restart) | | void | unscheduleDrawable(Drawable who, Runnable what) |

| | From class android.graphics.drawable.Drawable

| void | applyTheme(Resources.Theme arg0) | | boolean | canApplyTheme() | | void | clearColorFilter() | | final Rect | copyBounds() | | final void | copyBounds(Rect arg0) | | static Drawable | createFromPath(String arg0) | | static Drawable | createFromResourceStream(Resources arg0, TypedValue arg1, InputStream arg2, String arg3, BitmapFactory.Options arg4) | | static Drawable | createFromResourceStream(Resources arg0, TypedValue arg1, InputStream arg2, String arg3) | | static Drawable | createFromStream(InputStream arg0, String arg1) | | static Drawable | createFromXml(Resources arg0, XmlPullParser arg1) | | static Drawable | createFromXml(Resources arg0, XmlPullParser arg1, Resources.Theme arg2) | | static Drawable | createFromXmlInner(Resources arg0, XmlPullParser arg1, AttributeSet arg2, Resources.Theme arg3) | | static Drawable | createFromXmlInner(Resources arg0, XmlPullParser arg1, AttributeSet arg2) | | abstract void | draw(Canvas arg0) | | int | getAlpha() | | final Rect | getBounds() | | Drawable.Callback | getCallback() | | int | getChangingConfigurations() | | ColorFilter | getColorFilter() | | Drawable.ConstantState | getConstantState() | | Drawable | getCurrent() | | Rect | getDirtyBounds() | | void | getHotspotBounds(Rect arg0) | | int | getIntrinsicHeight() | | int | getIntrinsicWidth() | | int | getLayoutDirection() | | final int | getLevel() | | int | getMinimumHeight() | | int | getMinimumWidth() | | abstract int | getOpacity() | | void | getOutline(Outline arg0) | | boolean | getPadding(Rect arg0) | | int[] | getState() | | Region | getTransparentRegion() | | void | inflate(Resources arg0, XmlPullParser arg1, AttributeSet arg2, Resources.Theme arg3) | | void | inflate(Resources arg0, XmlPullParser arg1, AttributeSet arg2) | | void | invalidateSelf() | | boolean | isAutoMirrored() | | boolean | isFilterBitmap() | | boolean | isStateful() | | final boolean | isVisible() | | void | jumpToCurrentState() | | Drawable | mutate() | | void | onBoundsChange(Rect arg0) | | boolean | onLayoutDirectionChanged(int arg0) | | boolean | onLevelChange(int arg0) | | boolean | onStateChange(int[] arg0) | | static int | resolveOpacity(int arg0, int arg1) | | void | scheduleSelf(Runnable arg0, long arg1) | | abstract void | setAlpha(int arg0) | | void | setAutoMirrored(boolean arg0) | | void | setBounds(int arg0, int arg1, int arg2, int arg3) | | void | setBounds(Rect arg0) | | final void | setCallback(Drawable.Callback arg0) | | void | setChangingConfigurations(int arg0) | | void | setColorFilter(int arg0, PorterDuff.Mode arg1) | | abstract void | setColorFilter(ColorFilter arg0) | | void | setDither(boolean arg0) | | void | setFilterBitmap(boolean arg0) | | void | setHotspot(float arg0, float arg1) | | void | setHotspotBounds(int arg0, int arg1, int arg2, int arg3) | | final boolean | setLayoutDirection(int arg0) | | final boolean | setLevel(int arg0) | | boolean | setState(int[] arg0) | | void | setTint(int arg0) | | void | setTintList(ColorStateList arg0) | | void | setTintMode(PorterDuff.Mode arg0) | | boolean | setVisible(boolean arg0, boolean arg1) | | void | unscheduleSelf(Runnable arg0) |

| | From class java.lang.Object

| Object | clone() | | boolean | equals(Object arg0) | | void | finalize() | | final Class<?> | getClass() | | int | hashCode() | | final void | notify() | | final void | notifyAll() | | String | toString() | | final void | wait(long arg0, int arg1) | | final void | wait(long arg0) | | final void | wait() |

| | From interface android.graphics.drawable.Drawable.Callback

| abstract void | invalidateDrawable(Drawable arg0) | | abstract void | scheduleDrawable(Drawable arg0, Runnable arg1, long arg2) | | abstract void | unscheduleDrawable(Drawable arg0, Runnable arg1) |

| | From interface com.facebook.drawee.drawable.DrawableParent

| abstract Drawable | getDrawable() Gets the child drawable. | | abstract Drawable | setDrawable(Drawable newDrawable) Sets the new child drawable. |

| | From interface com.facebook.drawee.drawable.TransformAwareDrawable

| abstract void | setTransformCallback(TransformCallback transformCallback) Sets a transform callback. |

| | From interface com.facebook.drawee.drawable.TransformCallback

| abstract void | getRootBounds(RectF bounds) Called when the drawable needs to get its root bounds. | | abstract void | getTransform(Matrix transform) Called when the drawable needs to get all matrices applied to it. |

| | From interface com.facebook.drawee.drawable.VisibilityAwareDrawable

| abstract void | setVisibilityCallback(VisibilityCallback visibilityCallback) Sets a visibility callback. |

|

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)

+Generated by Doclava. +