The Developer Preview for Android 11 is now available; test it out and share your feedback.

GenericShape

data class GenericShape : Shape
kotlin.Any
   ↳ androidx.ui.foundation.shape.GenericShape

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

Summary

Public constructors

<init>(builder: Path.(size: PxSize) -> Unit)

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

Public methods

Outline
createOutline(size: PxSize, density: Density)

Creates Outline of this shape for the given size.

Inherited extension functions

From androidx.compose
operator T

IMPORTANT: This global operator is TEMPORARY, and should be removed whenever an answer for contextual composers is reached.

Public constructors

<init>

GenericShape(builder: Path.(size: PxSize) -> Unit)

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

Parameters
builder: Path.(size: PxSize) -> Unit the builder lambda to apply on a Path

Public methods

createOutline

fun createOutline(
    size: PxSize,
    density: Density
): Outline

Creates Outline of this shape for the given size.

Parameters
size: PxSize the size of the shape boundary.
density: Density the current density of the screen.
Return
Outline of this shape for the given size.