public class

PaintDrawable

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

Class Overview

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

Summary

[Expand]
Inherited XML Attributes
From class android.graphics.drawable.ShapeDrawable
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.
[Expand]
Inherited Methods
From class android.graphics.drawable.ShapeDrawable
From class android.graphics.drawable.Drawable
From class java.lang.Object

Public Constructors

public PaintDrawable ()

Since: API Level 1

public PaintDrawable (int color)

Since: API Level 1

Public Methods

public void setCornerRadii (float[] radii)

Since: API Level 1

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 setCornerRadius (float radius)

Since: API Level 1

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

Protected Methods

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

Since: API Level 1

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