public interface RhythmSpecLayer
Spec layer is a descriptor of a granular piece of overlay (e.g. a single line, a repeating line etc), which both
holds the configuration of its appearance (hence the spec) and is also capable of drawing itself onto the provided
canvas (hence the layer). Unlike Drawables, where separate instances are required each time they are used, spec layer
instances are created per configuration and can be reused across many RhythmDrawable
s (views,
overlays).
You can create custom spec layers by implementing this interface.
Modifier and Type | Method and Description |
---|---|
void |
draw(android.graphics.Canvas canvas,
android.graphics.Rect drawableBounds)
Draw itself to the provided canvas within provided bounds according to internal configuration (if any)
|
void draw(android.graphics.Canvas canvas, android.graphics.Rect drawableBounds)
canvas
- Canvas for the layer to draw itself todrawableBounds
- Bounds where this layer should draw itself. Since these are the bounds of a RhythmDrawable
connected to the view, they are usually the same as the view’s bounds, so
you can use this parameter to get the view’s dimensions should you need them.