public class

ArrayDrawable

extends Drawable
implements Drawable.Callback TransformAwareDrawable TransformCallback
java.lang.Object
   ↳ android.graphics.drawable.Drawable
     ↳ com.facebook.drawee.drawable.ArrayDrawable
Known Direct Subclasses

Class Overview

A Drawable that contains an array of other Drawables (layers). These are drawn in array order, so the element with the largest index will be drawn on top.

Similar to android's LayerDrawable but it doesn't support adding/removing layers dynamically.

Summary

Public Constructors
ArrayDrawable(Drawable[] layers)
Constructs a new layer drawable.
Public Methods
void draw(Canvas canvas)
Drawable getDrawable(int index)
Gets the drawable at the specified index.
DrawableParent getDrawableParentForIndex(int index)
Gets the DrawableParent for index.
int getIntrinsicHeight()
int getIntrinsicWidth()
int getNumberOfLayers()
Gets the number of layers.
int getOpacity()
boolean getPadding(Rect padding)
void getRootBounds(RectF bounds)
Called when the drawable needs to get its root bounds.
void getTransform(Matrix transform)
TransformationCallback methods
void invalidateDrawable(Drawable who)
Drawable.Callback methods
boolean isStateful()
Drawable mutate()
void scheduleDrawable(Drawable who, Runnable what, long when)
void setAlpha(int alpha)
void setColorFilter(ColorFilter colorFilter)
void setDither(boolean dither)
Drawable setDrawable(int index, Drawable drawable)
Sets a new drawable at the specified index, and return the previous drawable, if any.
void setFilterBitmap(boolean filterBitmap)
void setHotspot(float x, float y)
void setTransformCallback(TransformCallback transformCallback)
TransformationCallbackSetter method
boolean setVisible(boolean visible, boolean restart)
void unscheduleDrawable(Drawable who, Runnable what)
Protected Methods
void onBoundsChange(Rect bounds)
boolean onLevelChange(int level)
boolean onStateChange(int[] state)
[Expand]
Inherited Methods
From class android.graphics.drawable.Drawable
From class java.lang.Object
From interface android.graphics.drawable.Drawable.Callback
From interface com.facebook.drawee.drawable.TransformAwareDrawable
From interface com.facebook.drawee.drawable.TransformCallback

Public Constructors

public ArrayDrawable (Drawable[] layers)

Constructs a new layer drawable.

Parameters
layers the layers that this drawable displays

Public Methods

public void draw (Canvas canvas)

public Drawable getDrawable (int index)

Gets the drawable at the specified index.

Parameters
index index of drawable to get
Returns
  • drawable at the specified index

public DrawableParent getDrawableParentForIndex (int index)

Gets the DrawableParent for index.

public int getIntrinsicHeight ()

public int getIntrinsicWidth ()

public int getNumberOfLayers ()

Gets the number of layers.

Returns
  • number of layers

public int getOpacity ()

public boolean getPadding (Rect padding)

public void getRootBounds (RectF bounds)

Called when the drawable needs to get its root bounds.

Parameters
bounds The root bounds of the drawable.

public void getTransform (Matrix transform)

TransformationCallback methods

Parameters
transform Matrix that is applied to the drawable by the parent drawables.

public void invalidateDrawable (Drawable who)

Drawable.Callback methods

public boolean isStateful ()

public Drawable mutate ()

public void scheduleDrawable (Drawable who, Runnable what, long when)

public void setAlpha (int alpha)

public void setColorFilter (ColorFilter colorFilter)

public void setDither (boolean dither)

public Drawable setDrawable (int index, Drawable drawable)

Sets a new drawable at the specified index, and return the previous drawable, if any.

public void setFilterBitmap (boolean filterBitmap)

public void setHotspot (float x, float y)

public void setTransformCallback (TransformCallback transformCallback)

TransformationCallbackSetter method

Parameters
transformCallback the transform callback to be set

public boolean setVisible (boolean visible, boolean restart)

public void unscheduleDrawable (Drawable who, Runnable what)

Protected Methods

protected void onBoundsChange (Rect bounds)

protected boolean onLevelChange (int level)

protected boolean onStateChange (int[] state)