Android

android.graphics.drawable.shapes.RoundRectShape

java.lang.Object
android.graphics.drawable.shapes.Shape
android.graphics.drawable.shapes.RectShape
android.graphics.drawable.shapes.RoundRectShape

Creates a rounded-corner rectangle. Optionally, an inset (rounded) rectangle can be included (to make a sort of "O" shape). The rounded rectangle can be drawn to a Canvas with its own draw() method, but more graphical control is available if you instead pass the RoundRectShape to a ShapeDrawable.

Summary

Public Constructors

            RoundRectShape(float[] outerRadii, RectF inset, float[] innerRadii)
RoundRectShape constructor.

Public Methods

          void  draw(Canvas canvas, Paint paint)
Draw this shape into the provided Canvas, with the provided Paint.

Protected Methods

          void  onResize(float w, float h)
Callback method called when resize(float, float) is executed.
Methods inherited from class android.graphics.drawable.shapes.RectShape
Methods inherited from class android.graphics.drawable.shapes.Shape
Methods inherited from class java.lang.Object

Details

Public Constructors

public RoundRectShape(float[] outerRadii, RectF inset, float[] innerRadii)

RoundRectShape constructor. Specifies an outer (round)rect and an optional inner (round)rect.

Parameters

outerRadii An array of 8 radius values, for the outer roundrect. The first two floats are for the top-left corner (remaining pairs correspond clockwise). For no rounded corners on the outer rectangle, pass null.
inset A RectF that specifies the distance from the inner rect to each side of the outer rect. For no inner, pass null.
innerRadii An array of 8 radius values, for the inner roundrect. The first two floats are for the top-left corner (remaining pairs correspond clockwise). For no rounded corners on the inner rectangle, pass null. If inset parameter is null, this parameter is ignored.

Public Methods

public void draw(Canvas canvas, Paint paint)

Draw this shape into the provided Canvas, with the provided Paint. Before calling this, you must call resize(float, float).

Parameters

canvas the Canvas within which this shape should be drawn
paint the Paint object that defines this shape's characteristics

Protected Methods

protected void onResize(float w, float h)

Callback method called when resize(float, float) is executed.

Parameters

w the new width of the Shape
h the new height of the Shape
Copyright 2007 Google Inc. Build 0.9_r1-98467 - 14 Aug 2008 18:56