Build 1.0_r1(from source)

android.graphics.drawable.shapes
Class RoundRectShape

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

public class RoundRectShape
extends RectShape

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.


Constructor Summary
RoundRectShape(float[] outerRadii, RectF inset, float[] innerRadii)
          RoundRectShape constructor.
 
Method Summary
 void draw(Canvas canvas, Paint paint)
          Draw this shape into the provided Canvas, with the provided Paint.
protected  void onResize(float w, float h)
          Callback method called when Shape.resize(float,float) is executed.
 
Methods inherited from class android.graphics.drawable.shapes.RectShape
rect
 
Methods inherited from class android.graphics.drawable.shapes.Shape
getHeight, getWidth, hasAlpha, resize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RoundRectShape

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.
Method Detail

draw

public void draw(Canvas canvas,
                 Paint paint)
Description copied from class: Shape
Draw this shape into the provided Canvas, with the provided Paint. Before calling this, you must call Shape.resize(float,float).

Overrides:
draw in class RectShape
Parameters:
canvas - the Canvas within which this shape should be drawn
paint - the Paint object that defines this shape's characteristics

onResize

protected void onResize(float w,
                        float h)
Description copied from class: Shape
Callback method called when Shape.resize(float,float) is executed.

Overrides:
onResize in class RectShape
Parameters:
w - the new width of the Shape
h - the new height of the Shape

Build 1.0_r1(from source)

Please submit a feedback, bug or feature