Please note that the contents of this offline web site may be out of date. To access the most recent documentation visit the online version .
Note that links that point to online resources are green in color and will open in a new window.
We would love it if you could give us feedback about this material by filling this form (You have to be online to fill it)
Android APIs
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 ()

Added in API level 1

public PaintDrawable (int color)

Added in API level 1

Public Methods

public void setCornerRadii (float[] radii)

Added in 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)

Added in 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)

Added in API level 1

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