Android 12 Developer Preview is here! Try it out, and give us your feedback!

GenericShape

class GenericShape : Shape
kotlin.Any
   ↳ androidx.compose.foundation.shape.GenericShape

Creates Shape defined by applying the provided builder on a Path.

Summary

Public constructors
<init>(builder: Path.(size: Size, layoutDirection: LayoutDirection) -> Unit)

Creates Shape defined by applying the provided builder on a Path.

Public methods
Outline
createOutline(size: Size, layoutDirection: LayoutDirection, density: Density)

Creates Outline of this shape for the given size.

Boolean
equals(other: Any?)

Int

Public constructors

<init>

GenericShape(builder: Path.(size: Size, layoutDirection: LayoutDirection) -> Unit)

Creates Shape defined by applying the provided builder on a Path.

Parameters
builder: Path.(size: Size, layoutDirection: LayoutDirection) -> Unit the builder lambda to apply on a Path

Public methods

createOutline

fun createOutline(
    size: Size,
    layoutDirection: LayoutDirection,
    density: Density
): Outline

Creates Outline of this shape for the given size.

Parameters
size: Size the size of the shape boundary.
layoutDirection: LayoutDirection the current layout direction.
density: Density the current density of the screen.
Return
Outline of this shape for the given size.

equals

fun equals(other: Any?): Boolean

hashCode

fun hashCode(): Int