Added in API level 1

OvalShape


open class OvalShape : RectShape

Defines an oval shape.

The oval can be drawn to a Canvas with its own draw() method, but more graphical control is available if you instead pass the OvalShape to a android.graphics.drawable.ShapeDrawable.

Summary

Public constructors

Public methods
open OvalShape

open Unit
draw(canvas: Canvas!, paint: Paint!)

open Unit
getOutline(outline: Outline)

Inherited functions
Boolean equals(other: Any?)

Int hashCode()

Unit onResize(width: Float, height: Float)

RectF! rect()

Returns the RectF that defines this rectangle's bounds.

Float getHeight()

Returns the height of the Shape.

Float getWidth()

Returns the width of the Shape.

Boolean hasAlpha()

Checks whether the Shape is opaque.

Default impl returns true. Override if your subclass can be opaque.

Unit resize(width: Float, height: Float)

Resizes the dimensions of this shape.

Must be called before draw(android.graphics.Canvas,android.graphics.Paint).

Public constructors

OvalShape

Added in API level 1
OvalShape()

Public methods

clone

Added in API level 1
open fun clone(): OvalShape
Return
OvalShape a clone of this instance.
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

Added in API level 1
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

getOutline

Added in API level 21
open fun getOutline(outline: Outline): Unit
Parameters
outline Outline: the Outline to be populated with the result. Must be non-null.

Gradle builds for Android are split across many files in your project.

Updated Sep 4, 2024

How are libraries and tools related in your build?

Updated Nov 4, 2024

How should you upgrade dependencies in your build?

Updated Nov 1, 2024