public class

MatrixDrawable

extends ForwardingDrawable
java.lang.Object
   ↳ android.graphics.drawable.Drawable
     ↳ com.facebook.drawee.drawable.ForwardingDrawable
       ↳ com.facebook.drawee.drawable.MatrixDrawable

Class Overview

Drawable that can adjust underlying drawable based on specified Matrix.

Summary

[Expand]
Inherited Fields
From class com.facebook.drawee.drawable.ForwardingDrawable
Public Constructors
MatrixDrawable(Drawable drawable, Matrix matrix)
Creates a new MatrixDrawable with given underlying drawable and matrix.
Public Methods
void draw(Canvas canvas)
Matrix getMatrix()
Gets the current matrix.
void getTransform(Matrix transform)
TransformationCallback method
Drawable setCurrent(Drawable newDelegate)
Sets a new drawable to be the delegate, and returns the old one (or null).
void setMatrix(Matrix matrix)
Sets the matrix.
Protected Methods
void onBoundsChange(Rect bounds)
[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

Public Constructors

public MatrixDrawable (Drawable drawable, Matrix matrix)

Creates a new MatrixDrawable with given underlying drawable and matrix.

Parameters
drawable underlying drawable to apply the matrix to
matrix matrix to be applied to the drawable

Public Methods

public void draw (Canvas canvas)

public Matrix getMatrix ()

Gets the current matrix.

Returns
  • matrix

public void getTransform (Matrix transform)

TransformationCallback method

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

public Drawable setCurrent (Drawable newDelegate)

Sets a new drawable to be the delegate, and returns the old one (or null).

This method will cause the drawable to be invalidated.

Returns
  • the previous delegate

public void setMatrix (Matrix matrix)

Sets the matrix.

Parameters
matrix matrix to set

Protected Methods

protected void onBoundsChange (Rect bounds)