public class

RoundedCornersDrawable

extends ForwardingDrawable
implements Rounded
java.lang.Object
   ↳ android.graphics.drawable.Drawable
     ↳ com.facebook.drawee.drawable.ForwardingDrawable
       ↳ com.facebook.drawee.drawable.RoundedCornersDrawable

Class Overview

Drawable that draws underlying drawable with rounded corners.

Summary

Nested Classes
enum RoundedCornersDrawable.Type  
[Expand]
Inherited Fields
From class com.facebook.drawee.drawable.ForwardingDrawable
Public Constructors
RoundedCornersDrawable(Drawable drawable)
Creates a new RoundedCornersDrawable with given underlying drawable.
Public Methods
void draw(Canvas canvas)
int getBorderColor()
Gets the border color.
float getBorderWidth()
Gets the border width.
int getOverlayColor()
Gets the overlay color.
float getPadding()
Gets the padding.
float[] getRadii()
Gets the radii.
boolean isCircle()
Returns whether or not this drawable rounds as circle.
void setBorder(int color, float width)
Sets the border
void setCircle(boolean isCircle)
Sets whether to round as circle.
void setOverlayColor(int overlayColor)
Sets the overlay color.
void setPadding(float padding)
void setRadii(float[] radii)
Sets radii values to be used for rounding.
void setRadius(float radius)
Sets radius to be used for rounding
void setType(RoundedCornersDrawable.Type type)
Sets the type of rounding process
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.Rounded
From interface com.facebook.drawee.drawable.TransformAwareDrawable
From interface com.facebook.drawee.drawable.TransformCallback

Public Constructors

public RoundedCornersDrawable (Drawable drawable)

Creates a new RoundedCornersDrawable with given underlying drawable.

Parameters
drawable underlying drawable

Public Methods

public void draw (Canvas canvas)

public int getBorderColor ()

Gets the border color.

public float getBorderWidth ()

Gets the border width.

public int getOverlayColor ()

Gets the overlay color.

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 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 setOverlayColor (int overlayColor)

Sets the overlay color.

Parameters
overlayColor the color to filled outside the rounded corners

public void setPadding (float padding)

public void setRadii (float[] radii)

Sets radii values to be used for rounding. Each corner receive two radius values [X, Y]. The corners are ordered top-left, top-right, bottom-right, bottom-left

Parameters
radii Array of 8 values, 4 pairs of [X,Y] radii

public void setRadius (float radius)

Sets radius to be used for rounding

Parameters
radius corner radius in pixels

public void setType (RoundedCornersDrawable.Type type)

Sets the type of rounding process

Parameters
type type of rounding process

Protected Methods

protected void onBoundsChange (Rect bounds)