public abstract class

RoundedDrawable

extends Drawable
implements Rounded TransformAwareDrawable
java.lang.Object
   ↳ android.graphics.drawable.Drawable
     ↳ com.facebook.drawee.drawable.RoundedDrawable
Known Direct Subclasses

Summary

Fields
protected int mBorderColor
protected final Path mBorderPath
protected float mBorderWidth
protected boolean mIsCircle
protected boolean mIsShaderTransformDirty
protected final Path mPath
protected boolean mRadiiNonZero
Public Methods
void clearColorFilter()
void draw(Canvas canvas)
int getAlpha()
int getBorderColor()
Gets the border color.
float getBorderWidth()
Gets the border width.
ColorFilter getColorFilter()
int getIntrinsicHeight()
int getIntrinsicWidth()
int getOpacity()
float getPadding()
Gets the padding.
boolean getPaintFilterBitmap()
Gets whether to set FILTER_BITMAP_FLAG flag to Paint.
float[] getRadii()
Gets the radii.
boolean getScaleDownInsideBorders()
Gets whether image should be scaled down inside borders.
boolean isCircle()
Returns whether or not this drawable rounds as circle.
void setAlpha(int alpha)
void setBorder(int color, float width)
Sets the border
void setCircle(boolean isCircle)
Sets whether to round as circle.
void setColorFilter(ColorFilter colorFilter)
void setColorFilter(int color, PorterDuff.Mode mode)
void setPadding(float padding)
Sets the padding for the bitmap.
void setPaintFilterBitmap(boolean paintFilterBitmap)
Sets FILTER_BITMAP_FLAG flag to Paint.
void setRadii(float[] radii)
Specify radii for each of the 4 corners.
void setRadius(float radius)
Specify radius for the corners of the rectangle.
void setScaleDownInsideBorders(boolean scaleDownInsideBorders)
Sets whether image should be scaled down inside borders.
void setTransformCallback(TransformCallback transformCallback)
TransformAwareDrawable method
Protected Methods
void onBoundsChange(Rect bounds)
void updatePath()
void updateTransform()
[Expand]
Inherited Methods
From class android.graphics.drawable.Drawable
From class java.lang.Object
From interface com.facebook.drawee.drawable.Rounded
From interface com.facebook.drawee.drawable.TransformAwareDrawable

Fields

protected int mBorderColor

protected final Path mBorderPath

protected float mBorderWidth

protected boolean mIsCircle

protected boolean mIsShaderTransformDirty

protected final Path mPath

protected boolean mRadiiNonZero

Public Methods

public void clearColorFilter ()

public void draw (Canvas canvas)

public int getAlpha ()

public int getBorderColor ()

Gets the border color.

public float getBorderWidth ()

Gets the border width.

public ColorFilter getColorFilter ()

public int getIntrinsicHeight ()

public int getIntrinsicWidth ()

public int getOpacity ()

public float getPadding ()

Gets the padding.

public boolean getPaintFilterBitmap ()

Gets whether to set FILTER_BITMAP_FLAG flag to Paint.

public float[] getRadii ()

Gets the radii.

public boolean getScaleDownInsideBorders ()

Gets whether image should be scaled down inside borders.

public boolean isCircle ()

Returns whether or not this drawable rounds as circle.

public void setAlpha (int alpha)

public void setBorder (int color, float width)

Sets the border

Parameters
color of the border
width of the border

public void setCircle (boolean isCircle)

Sets whether to round as circle.

Parameters
isCircle whether or not to round as circle

public void setColorFilter (ColorFilter colorFilter)

public void setColorFilter (int color, PorterDuff.Mode mode)

public void setPadding (float padding)

Sets the padding for the bitmap.

public void setPaintFilterBitmap (boolean paintFilterBitmap)

Sets FILTER_BITMAP_FLAG flag to Paint. FILTER_BITMAP_FLAG

This should generally be on when drawing bitmaps, unless performance-bound (rendering to software canvas) or preferring pixelation artifacts to blurriness when scaling significantly.

Parameters
paintFilterBitmap whether to set FILTER_BITMAP_FLAG flag to Paint.

public void setRadii (float[] radii)

Specify radii for each of the 4 corners. For each corner, the array contains 2 values, [X_radius, Y_radius]. The corners are ordered top-left, top-right, bottom-right, bottom-left

Parameters
radii the x and y radii of the corners

public void setRadius (float radius)

Specify radius for the corners of the rectangle. If this is > 0, then the drawable is drawn in a round-rectangle, rather than a rectangle.

Parameters
radius the radius for the corners of the rectangle

public void setScaleDownInsideBorders (boolean scaleDownInsideBorders)

Sets whether image should be scaled down inside borders.

public void setTransformCallback (TransformCallback transformCallback)

TransformAwareDrawable method

Parameters
transformCallback the transform callback to be set

Protected Methods

protected void onBoundsChange (Rect bounds)

protected void updatePath ()

protected void updateTransform ()