# Print output for @column tags ?> PaintDrawable - Android SDK | Android Developers

Most visited


Recently visited


PaintDrawable

public class PaintDrawable
extends ShapeDrawable

java.lang.Object
   ↳ android.graphics.drawable.Drawable
     ↳ android.graphics.drawable.ShapeDrawable
       ↳ android.graphics.drawable.PaintDrawable


Drawable that draws its bounds in the given paint, with optional rounded corners.

Summary


Inherited XML attributes

Public constructors

PaintDrawable()
PaintDrawable(int color)

Public methods

void setCornerRadii(float[] radii)

Specify radii for each of the 4 corners.

void setCornerRadius(float radius)

Specify radius for the corners of the rectangle.

Protected methods

boolean inflateTag(String name, Resources r, XmlPullParser parser, AttributeSet attrs)

Subclasses override this to parse custom subelements.

Inherited methods

Public constructors


PaintDrawable

public PaintDrawable ()

PaintDrawable

public PaintDrawable (int color)

Parameters
color int

Public methods


setCornerRadii

public void setCornerRadii (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 float: the x and y radii of the corners

setCornerRadius

public void setCornerRadius (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 float: the radius for the corners of the rectangle

Protected methods


inflateTag

protected boolean inflateTag (String name, 
                Resources r, 
                XmlPullParser parser, 
                AttributeSet attrs)

Subclasses override this to parse custom subelements. If you handle it, return true, else return super.inflateTag(...).

Parameters
name String

r Resources

parser XmlPullParser

attrs AttributeSet

Returns
boolean

Browse this site in English?

You requested a page in English, but your language preference for this site is English.

Would you like to change your language preference and browse this site in English? If you want to change your language preference later, use the language menu at the bottom of each page.