We just launched Compose Examples featuring over 150+ components! Check it out →

CurvedRow

Android

Component in Glance Wear Tiles

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.

Last updated:

Installation

dependencies {
   implementation("androidx.glance:glance-wear-tiles:1.0.0-alpha05")
}

Overloads

@Composable
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].
by @alexstyl