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

Shape

public interface Shape

Known direct subclasses
CornerBasedShape

Base class for Shapes defined by four CornerSizes.

GenericShape

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

Known indirect subclasses
AbsoluteCutCornerShape

A shape describing the rectangle with cut corners.

AbsoluteRoundedCornerShape

A shape describing the rectangle with rounded corners.

CutCornerShape

A shape describing the rectangle with cut corners.

RoundedCornerShape

A shape describing the rectangle with rounded corners.


Defines a generic shape.

Summary

Public methods

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

Creates Outline of this shape for the given size.

Public methods

createOutline

abstract @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.