android.graphics.drawable.shapes.Shape
Defines a generic graphical "shape."
Any Shape can be drawn to a Canvas with its own draw() method,
but more graphical control is available if you instead pass
it to a ShapeDrawable.
Known Direct Subclasses
Known Indirect Subclasses
Summary
Public Constructors
Public Methods
Protected Methods
|
|
|
|
|
void |
onResize(float width, float height) |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait
Details
Public Constructors
Public Methods
public
abstract
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
|
public
final
float
getHeight()
Returns the height of the Shape.
public
final
float
getWidth()
Returns the width of the Shape.
public
boolean
hasAlpha()
Checks whether the Shape is opaque.
Default impl returns true. Override if your subclass can be opaque.
Returns
- true if any part of the drawable is not opaque.
public
final
void
resize(float width, float height)
Resizes the dimensions of this shape.
Must be called before
draw(Canvas, Paint).
Parameters
width
| the width of the shape (in pixels) |
height
| the height of the shape (in pixels)
|
Protected Methods
protected
void
onResize(float width, float height)
Callback method called when
resize(float, float) is executed.
Parameters
width
| the new width of the Shape |
height
| the new height of the Shape
|