java.lang.Object | ||
↳ | android.graphics.drawable.Drawable | |
↳ | com.facebook.drawee.drawable.ForwardingDrawable |
Known Direct Subclasses |
A forwarding drawable class - the goal is to forward (delegate) drawable functionality to an inner drawable instance. ForwardingDrawable intercepts the public (and protected) methods of Drawable, maintains local state if needed.
Design note: It would have been very helpful to re-use Android library classes like DrawableContainer, LevelListDrawable etc. DrawableContainer is not directly subclassable, and the others don't allow changing the member drawables.
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
protected TransformCallback | mTransformCallback |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
ForwardingDrawable(Drawable drawable)
Constructs a new forwarding drawable.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
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 |
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 | 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).
| ||||||||||
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) |
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void | getParentTransform(Matrix transform) | ||||||||||
void | onBoundsChange(Rect bounds) | ||||||||||
boolean | onLevelChange(int level) | ||||||||||
boolean | onStateChange(int[] state) | ||||||||||
Drawable |
setCurrentWithoutInvalidate(Drawable newDelegate)
As
setCurrent , but without invalidating a drawable. |
[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.DrawableParent
| |||||||||||
From interface
com.facebook.drawee.drawable.TransformAwareDrawable
| |||||||||||
From interface
com.facebook.drawee.drawable.TransformCallback
|
Constructs a new forwarding drawable.
drawable | drawable that this forwarding drawable will forward to |
---|
Gets the child drawable.
Called when the drawable needs to get its root bounds.
bounds | The root bounds of the drawable. |
---|
Called when the drawable needs to get all matrices applied to it.
transform | Matrix that is applied to the drawable by the parent drawables. |
---|
Gets the transformed bounds of this drawable. Note: bounds are not cropped (otherwise they would likely be the same as drawable's bounds).
outBounds | rect to fill with bounds |
---|
Sets a new drawable to be the delegate, and returns the old one (or null).
This method will cause the drawable to be invalidated.
Sets the new child drawable.
newDrawable | a new child drawable to set |
---|
Sets a transform callback.
transformCallback | the transform callback to be set |
---|
As setCurrent
, but without invalidating a drawable. Subclasses are responsible to call
invalidateSelf
on their own.