CurvedSemanticsScope

class CurvedSemanticsScope


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

Summary

Public constructors

Public properties

String?

Developer-set content description of the semantics node.

Float

A value to manually control screenreader traversal order.

Public constructors

CurvedSemanticsScope

Added in 1.5.0-alpha11
CurvedSemanticsScope()

Public properties

contentDescription

Added in 1.5.0-alpha11
var contentDescriptionString?

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

Added in 1.5.0-alpha11
var traversalIndexFloat

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.