Methods Summary |
---|
public android.graphics.drawable.shapes.Shape | clone()
return (Shape) super.clone();
|
public abstract void | draw(android.graphics.Canvas canvas, android.graphics.Paint paint)Draw this shape into the provided Canvas, with the provided Paint.
Before calling this, you must call {@link #resize(float,float)}.
|
public final float | getHeight()Returns the height of the Shape.
return mHeight;
|
public final float | getWidth()Returns the width of the Shape.
return mWidth;
|
public boolean | hasAlpha()Checks whether the Shape is opaque.
Default impl returns true. Override if your subclass can be opaque.
return true;
|
protected void | onResize(float width, float height)Callback method called when {@link #resize(float,float)} is executed.
|
public final void | resize(float width, float height)Resizes the dimensions of this shape.
Must be called before {@link #draw(Canvas,Paint)}.
if (width < 0) {
width = 0;
}
if (height < 0) {
height =0;
}
if (mWidth != width || mHeight != height) {
mWidth = width;
mHeight = height;
onResize(width, height);
}
|