{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

GenericShape

public final class GenericShape implements Shape


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

Summary

Public constructors

Public methods

@NonNull Outline
createOutline(
    @NonNull Size size,
    @NonNull LayoutDirection layoutDirection,
    @NonNull Density density
)

Creates Outline of this shape for the given size.

boolean
equals(Object other)
int

Public constructors

GenericShape

public GenericShape(
    @ExtensionFunctionType @NonNull Function3<@NonNull Path, @NonNull Size, @NonNull LayoutDirectionUnit> builder
)
Parameters
@ExtensionFunctionType @NonNull Function3<@NonNull Path, @NonNull Size, @NonNull LayoutDirectionUnit> builder

the builder lambda to apply on a Path

Public methods

createOutline

public @NonNull Outline createOutline(
    @NonNull Size size,
    @NonNull LayoutDirection layoutDirection,
    @NonNull Density density
)

Creates Outline of this shape for the given size.

Parameters
@NonNull Size size

the size of the shape boundary.

@NonNull LayoutDirection layoutDirection

the current layout direction.

@NonNull Density density

the current density of the screen.

Returns
@NonNull Outline

Outline of this shape for the given size.

equals

public boolean equals(Object other)

hashCode

public int hashCode()