public class

RoundedBitmapDrawable

extends BitmapDrawable
implements Rounded TransformAwareDrawable
java.lang.Object
   ↳ android.graphics.drawable.Drawable
     ↳ android.graphics.drawable.BitmapDrawable
       ↳ com.facebook.drawee.drawable.RoundedBitmapDrawable

Class Overview

A drawable that can have rounded corners.

Summary

Public Constructors
RoundedBitmapDrawable(Resources res, Bitmap bitmap)
RoundedBitmapDrawable(Resources res, Bitmap bitmap, Paint paint)
Public Methods
void draw(Canvas canvas)
static RoundedBitmapDrawable fromBitmapDrawable(Resources res, BitmapDrawable bitmapDrawable)
Creates a new RoundedBitmapDrawable from the given BitmapDrawable.
int getBorderColor()
Gets the border color.
float getBorderWidth()
Gets the border width.
float getPadding()
Gets the padding.
float[] getRadii()
Gets the radii.
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 setPadding(float padding)
Sets the padding for the bitmap.
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 setTransformCallback(TransformCallback transformCallback)
TransformAwareDrawable method
[Expand]
Inherited Methods
From class android.graphics.drawable.BitmapDrawable
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

Public Constructors

public RoundedBitmapDrawable (Resources res, Bitmap bitmap)

public RoundedBitmapDrawable (Resources res, Bitmap bitmap, Paint paint)

Public Methods

public void draw (Canvas canvas)

public static RoundedBitmapDrawable fromBitmapDrawable (Resources res, BitmapDrawable bitmapDrawable)

Creates a new RoundedBitmapDrawable from the given BitmapDrawable.

Parameters
res resources to use for this drawable
bitmapDrawable bitmap drawable containing the bitmap to be used for this drawable
Returns
  • the RoundedBitmapDrawable that is created

public int getBorderColor ()

Gets the border color.

public float getBorderWidth ()

Gets the border width.

public float getPadding ()

Gets the padding.

public float[] getRadii ()

Gets the radii.

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 setPadding (float padding)

Sets the padding for the bitmap.

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 setTransformCallback (TransformCallback transformCallback)

TransformAwareDrawable method

Parameters
transformCallback the transform callback to be set