androidx.glance.wear.tiles.curved

Interfaces

CurvedChildScope
CurvedScope

A scope for elements which can only be contained within a CurvedRow.

GlanceCurvedModifier

An ordered, immutable, collection of modifier element that works with curved components in the Glance library.

GlanceCurvedModifier.Element

A single element contained within a GlanceCurvedModifier chain.

Classes

AnchorType

The alignment of a CurvedRow's elements, with respect to its anchor angle.

CombinedGlanceCurvedModifier

A node in a GlanceCurvedModifier chain.

CurvedTextStyle

Description of a text style for the CurvedScope.curvedText composable.

RadialAlignment

How to lay down components when they are thinner than the CurvedRow.

Objects

GlanceCurvedModifier.Companion

The companion object Modifier is the empty, default, or starter GlanceCurvedModifier that contains no elements.

Annotations

Top-level functions summary

Unit
@Composable
CurvedRow(
    modifier: GlanceModifier,
    anchorDegrees: Float,
    anchorType: AnchorType,
    radialAlignment: RadialAlignment,
    content: CurvedScope.() -> Unit
)

A curved layout container.

Extension functions summary

GlanceCurvedModifier

Apply an Action, to be executed in response to a user click

GlanceCurvedModifier

Associate accessibility semantics with an element.

GlanceCurvedModifier

Sets the sweep angle of the curved element, in degrees

GlanceCurvedModifier

Sets the thickness of the curved element, in Dp

Top-level functions

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

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.

Parameters
modifier: GlanceModifier = GlanceModifier

Modifiers for this container.

anchorDegrees: Float = 270.0f

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.

anchorType: AnchorType = AnchorType.Center

Alignment of the contents of this container relative to anchorDegrees.

radialAlignment: RadialAlignment = RadialAlignment.Center

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).

content: CurvedScope.() -> Unit

The content of this CurvedRow.

Extension functions

fun GlanceCurvedModifier.clickable(onClick: Action): GlanceCurvedModifier

Apply an Action, to be executed in response to a user click

fun GlanceCurvedModifier.semantics(properties: SemanticsPropertyReceiver.() -> Unit): GlanceCurvedModifier

Associate accessibility semantics with an element. This should generally be used sparingly, amd in mose cases should only be applied to the top-level layout element or clickable elements.

sweepAngleDegrees

fun GlanceCurvedModifier.sweepAngleDegrees(degrees: Float): GlanceCurvedModifier

Sets the sweep angle of the curved element, in degrees

fun GlanceCurvedModifier.thickness(thickness: Dp): GlanceCurvedModifier

Sets the thickness of the curved element, in Dp