RoundRectShape
open class RoundRectShape : 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 android.graphics.drawable.ShapeDrawable
.
Summary
Public constructors |
RoundRectShape constructor.
|
Protected methods |
open Unit |
|
Inherited functions |
|
From class RectShape
RectF! |
rect()
Returns the RectF that defines this rectangle's bounds.
|
|
Public constructors
RoundRectShape
RoundRectShape(
outerRadii: FloatArray?,
inset: RectF?,
innerRadii: FloatArray?)
RoundRectShape constructor.
Specifies an outer (round)rect and an optional inner (round)rect.
Parameters |
outerRadii |
FloatArray?: 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 |
RectF?: A RectF that specifies the distance from the inner rect to each side of the outer rect. For no inner, pass null . |
innerRadii |
FloatArray?: 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
clone
open fun clone(): RoundRectShape
Exceptions |
java.lang.CloneNotSupportedException |
if the object's class does not support the Cloneable interface. Subclasses that override the clone method can also throw this exception to indicate that an instance cannot be cloned. |
draw
open fun draw(
canvas: Canvas!,
paint: Paint!
): Unit
Parameters |
canvas |
Canvas!: the Canvas within which this shape should be drawn |
paint |
Paint!: the Paint object that defines this shape's characteristics |
equals
open fun equals(other: Any?): Boolean
Parameters |
obj |
the reference object with which to compare. |
Return |
Boolean |
true if this object is the same as the obj argument; false otherwise. |
getOutline
open fun getOutline(outline: Outline): Unit
Parameters |
outline |
Outline: the Outline to be populated with the result. Must be non-null . |
hashCode
open fun hashCode(): Int
Return |
Int |
a hash code value for this object. |
Protected methods
onResize
protected open fun onResize(
w: Float,
h: Float
): Unit
Parameters |
width |
the new width of the Shape |
height |
the new height of the Shape |