Class

CurvedSemanticsScope

CurvedSemanticsScope is the scope provided by semantics lambda blocks, letting you set semantic properties.

Source set: Android
public class CurvedSemanticsScope

CurvedSemanticsScope is the scope provided by semantics lambda blocks, letting you set semantic properties.

Properties

contentDescription

Source set: Android
public var contentDescription: String? = null

Developer-set content description of the semantics node.

If this is not set, accessibility services will present the text of this node as the content.

traversalIndex

Source set: Android
public var traversalIndex: Float = Float.NaN

A value to manually control screenreader traversal order.

This API can be used to customize TalkBack traversal order. When the traversalIndex property is set on a traversalGroup or on a screenreader-focusable node, then the sorting algorithm will prioritize nodes with smaller traversalIndexs earlier. The default traversalIndex value is zero, and traversalIndices are compared at a peer level.

For example, traversalIndex = -1f can be used to force a top bar to be ordered earlier, and traversalIndex = 1f to make a bottom bar ordered last, in the edge cases where this does not happen by default. As another example, if you need to reorder two Buttons within a Row, then you can set isTraversalGroup = true on the Row, and set traversalIndex on one of the Buttons.

Note that if traversalIndex seems to have no effect, be sure to set isTraversalGroup = true as well in a parent node.

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: