Function

RoundRect

Construct a rounded rectangle from its left, top, right, and bottom edges, and the same radii along its horizontal axis and its vertical axis.

RoundRect

Source set: Common
public fun RoundRect(
    left: Float,
    top: Float,
    right: Float,
    bottom: Float,
    radiusX: Float,
    radiusY: Float,
): RoundRect

Construct a rounded rectangle from its left, top, right, and bottom edges, and the same radii along its horizontal axis and its vertical axis.

RoundRect

Source set: Common
public fun RoundRect(
    left: Float,
    top: Float,
    right: Float,
    bottom: Float,
    cornerRadius: CornerRadius,
): RoundRect

Construct a rounded rectangle from its left, top, right, and bottom edges, and the same radius in each corner.

RoundRect

Source set: Common
public fun RoundRect(rect: Rect, radiusX: Float, radiusY: Float): RoundRect

Construct a rounded rectangle from its bounding box and the same radii along its horizontal axis and its vertical axis.

RoundRect

Source set: Common
public fun RoundRect(rect: Rect, cornerRadius: CornerRadius): RoundRect

Construct a rounded rectangle from its bounding box and a radius that is the same in each corner.

RoundRect

Source set: Common
public fun RoundRect(
    rect: Rect,
    topLeft: CornerRadius = CornerRadius.Zero,
    topRight: CornerRadius = CornerRadius.Zero,
    bottomRight: CornerRadius = CornerRadius.Zero,
    bottomLeft: CornerRadius = CornerRadius.Zero,
): RoundRect

Construct a rounded rectangle from its bounding box and topLeft, topRight, bottomRight, and bottomLeft radii.

The corner radii default to CornerRadius.Zero, i.e. right-angled corners

Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: