State of Compose 2023 results are in! Click here to learn more

← Back to Glance Wear Tiles

CurvedRow

Component
in
Glance Wear Tiles
. Since 1.0.0-alpha02

Overview

Code Examples

Video

A curved layout container. This container will fill itself to a circle, which fits inside its parent container, and all of its children will be placed on that circle. The parameters anchorDegrees and anchorType can be used to specify where to draw children within this circle. Each child will then be placed, one after the other, clockwise around the circle.

While this container can hold any composable element, only those built specifically to work inside of a CurvedRow container (e.g. CurvedScope.curvedText) will adapt themselves to the CurvedRow. Any other element wrapped in CurvedScope.curvedComposable will be drawn normally, at a tangent to the circle or straight up depending on the value of rotateContent.

@param modifier Modifiers for this container. @param anchorDegrees The angle for the anchor in degrees, used with anchorType to determine where to draw children. Note that 0 degrees is the 3 o'clock position on a device, and the angle sweeps clockwise. Values do not have to be clamped to the range 0-360; values less than 0 degrees will sweep anti-clockwise (i.e. -90 degrees is equivalent to 270 degrees), and values >360 will be be placed at X mod 360 degrees. @param anchorType Alignment of the contents of this container relative to anchorDegrees. @param radialAlignment specifies where to lay down children that are thinner than the CurvedRow, either closer to the center (INNER), apart from the center (OUTER) or in the middle point (CENTER). @param content The content of this CurvedRow.

Overloads

CurvedRow

@Composable
public fun CurvedRow(
    modifier: GlanceModifier = GlanceModifier,
    anchorDegrees: Float = 270f,
    anchorType: AnchorType = AnchorType.Center,
    radialAlignment: RadialAlignment = RadialAlignment.Center,
    content: CurvedScope.() -> Unit
)

Parameters

NameDescription
modifierModifiers for this container.
anchorDegreesThe angle for the anchor in degrees, used with anchorType to determine where to draw children. Note that 0 degrees is the 3 o'clock position on a device, and the angle sweeps clockwise. Values do not have to be clamped to the range 0-360; values less than 0 degrees will sweep anti-clockwise (i.e. -90 degrees is equivalent to 270 degrees), and values >360 will be be placed at X mod 360 degrees.
anchorTypeAlignment of the contents of this container relative to anchorDegrees.
radialAlignmentspecifies where to lay down children that are thinner than the CurvedRow, either closer to the center (INNER), apart from the center (OUTER) or in the middle point (CENTER).
contentThe content of this CurvedRow