public object SemanticsProperties
General semantics properties, mainly used for accessibility and testing.
Each of these is intended to be set by the respective SemanticsPropertyReceiver extension instead of used directly. / /*@VisibleForTesting
Properties
ContentDescription
public val ContentDescription: SemanticsPropertyKey<List<String>> =
AccessibilityKey<List<String>>(
name = "ContentDescription",
mergePolicy = { parentValue, childValue ->
parentValue?.toMutableList()?.also { it.addAll(childValue) } ?: childValue
},
)
StateDescription
public val StateDescription: SemanticsPropertyKey<String> =
AccessibilityKey<String>("StateDescription")
ProgressBarRangeInfo
public val ProgressBarRangeInfo: SemanticsPropertyKey<ProgressBarRangeInfo> =
AccessibilityKey<ProgressBarRangeInfo>("ProgressBarRangeInfo")
PaneTitle
public val PaneTitle: SemanticsPropertyKey<String> =
AccessibilityKey<String>(
name = "PaneTitle",
mergePolicy = { _, _ ->
throw IllegalStateException(
"merge function called on unmergeable property PaneTitle."
)
},
)
SelectableGroup
public val SelectableGroup: SemanticsPropertyKey<Unit> =
AccessibilityKey<Unit>("SelectableGroup")
CollectionInfo
public val CollectionInfo: SemanticsPropertyKey<CollectionInfo> =
AccessibilityKey<CollectionInfo>("CollectionInfo")
CollectionItemInfo
public val CollectionItemInfo: SemanticsPropertyKey<CollectionItemInfo> =
AccessibilityKey<CollectionItemInfo>("CollectionItemInfo")
Heading
public val Heading: SemanticsPropertyKey<Unit> = AccessibilityKey<Unit>("Heading")
TextEntryKey
public val TextEntryKey: SemanticsPropertyKey<Unit> = AccessibilityKey<Unit>("TextEntryKey")
Disabled
public val Disabled: SemanticsPropertyKey<Unit> = AccessibilityKey<Unit>("Disabled")
LiveRegion
public val LiveRegion: SemanticsPropertyKey<LiveRegionMode> =
AccessibilityKey<LiveRegionMode>("LiveRegion")
Focused
public val Focused: SemanticsPropertyKey<Boolean> = AccessibilityKey<Boolean>("Focused")
IsContainer
@Deprecated("Use `isTraversalGroup` instead.", replaceWith = ReplaceWith("IsTraversalGroup"))
// TODO(mnuzen): `isContainer` should not need to be an accessibility key after a new
// pruning API is added. See b/347038246 for more details.
public val IsContainer: SemanticsPropertyKey<Boolean> = AccessibilityKey<Boolean>("IsContainer")
IsTraversalGroup
public val IsTraversalGroup: SemanticsPropertyKey<Boolean> =
SemanticsPropertyKey<Boolean>("IsTraversalGroup")
IsSensitiveData
public val IsSensitiveData: SemanticsPropertyKey<Boolean> =
SemanticsPropertyKey<Boolean>("IsSensitiveData")
InvisibleToUser
@Deprecated(
"Use `hideFromAccessibility` instead.",
replaceWith = ReplaceWith("HideFromAccessibility"),
)
// Retain for binary compatibility with aosp/3341487 in 1.7
public val InvisibleToUser: SemanticsPropertyKey<Unit> =
SemanticsPropertyKey<Unit>(
name = "InvisibleToUser",
mergePolicy = { parentValue, _ -> parentValue },
)
HideFromAccessibility
public val HideFromAccessibility: SemanticsPropertyKey<Unit> =
SemanticsPropertyKey<Unit>(
name = "HideFromAccessibility",
mergePolicy = { parentValue, _ -> parentValue },
)
ContentType
public val ContentType: SemanticsPropertyKey<ContentType> =
SemanticsPropertyKey<ContentType>(
name = "ContentType",
mergePolicy = { parentValue, _ ->
// Never merge autofill types
parentValue
},
)
ContentDataType
public val ContentDataType: SemanticsPropertyKey<ContentDataType> =
SemanticsPropertyKey<ContentDataType>(
name = "ContentDataType",
mergePolicy = { parentValue, _ ->
// Never merge autofill data types
parentValue
},
)
FillableData
public val FillableData: SemanticsPropertyKey<FillableData> =
SemanticsPropertyKey<FillableData>(
name = "FillableData",
mergePolicy = { parentValue, _ ->
// Never merge autofill types
parentValue
},
)
TraversalIndex
public val TraversalIndex: SemanticsPropertyKey<Float> =
SemanticsPropertyKey<Float>(
name = "TraversalIndex",
mergePolicy = { parentValue, _ ->
// Never merge traversal indices
parentValue
},
)
HintText
public val HintText: SemanticsPropertyKey<String> = AccessibilityKey<String>(name = "HintText")
HorizontalScrollAxisRange
public val HorizontalScrollAxisRange: SemanticsPropertyKey<ScrollAxisRange> =
AccessibilityKey<ScrollAxisRange>("HorizontalScrollAxisRange")
VerticalScrollAxisRange
public val VerticalScrollAxisRange: SemanticsPropertyKey<ScrollAxisRange> =
AccessibilityKey<ScrollAxisRange>("VerticalScrollAxisRange")
IsPopup
public val IsPopup: SemanticsPropertyKey<Unit> =
AccessibilityKey<Unit>(
name = "IsPopup",
mergePolicy = { _, _ ->
throw IllegalStateException(
"merge function called on unmergeable property IsPopup. " +
"A popup should not be a child of a clickable/focusable node."
)
},
)
IsDialog
public val IsDialog: SemanticsPropertyKey<Unit> =
AccessibilityKey<Unit>(
name = "IsDialog",
mergePolicy = { _, _ ->
throw IllegalStateException(
"merge function called on unmergeable property IsDialog. " +
"A dialog should not be a child of a clickable/focusable node."
)
},
)
Role
public val Role: SemanticsPropertyKey<Role> =
AccessibilityKey<Role>("Role") { parentValue, _ -> parentValue }
The type of user interface element. Accessibility services might use this to describe the element or do customizations. Most roles can be automatically resolved by the semantics properties of this element. But some elements with subtle differences need an exact role. If an exact role is not listed in Role, this property should not be set and the framework will automatically resolve it.
TestTag
public val TestTag: SemanticsPropertyKey<String> =
SemanticsPropertyKey<String>(
name = "TestTag",
isImportantForAccessibility = false,
mergePolicy = { parentValue, _ ->
// Never merge TestTags, to avoid leaking internal test tags to parents.
parentValue
},
)
LinkTestMarker
public val LinkTestMarker: SemanticsPropertyKey<Unit> =
SemanticsPropertyKey<Unit>(
name = "LinkTestMarker",
isImportantForAccessibility = false,
mergePolicy = { parentValue, _ -> parentValue },
)
Marks a link within a text node (a link is represented by a androidx.compose.ui.text.LinkAnnotation) for identification during automated testing. This property is for internal use only and not intended for general use by developers.
Text
public val Text: SemanticsPropertyKey<List<AnnotatedString>> =
AccessibilityKey<List<AnnotatedString>>(
name = "Text",
mergePolicy = { parentValue, childValue ->
parentValue?.toMutableList()?.also { it.addAll(childValue) } ?: childValue
},
)
TextSubstitution
public val TextSubstitution: SemanticsPropertyKey<AnnotatedString> =
SemanticsPropertyKey<AnnotatedString>(name = "TextSubstitution")
IsShowingTextSubstitution
public val IsShowingTextSubstitution: SemanticsPropertyKey<Boolean> =
SemanticsPropertyKey<Boolean>("IsShowingTextSubstitution")
InputText
public val InputText: SemanticsPropertyKey<AnnotatedString> =
AccessibilityKey<AnnotatedString>(name = "InputText")
EditableText
public val EditableText: SemanticsPropertyKey<AnnotatedString> =
AccessibilityKey<AnnotatedString>(name = "EditableText")
TextSelectionRange
public val TextSelectionRange: SemanticsPropertyKey<TextRange> =
AccessibilityKey<TextRange>("TextSelectionRange")
TextCompositionRange
public val TextCompositionRange: SemanticsPropertyKey<TextRange?> =
AccessibilityKey<TextRange?>("TextCompositionRange")
ImeAction
public val ImeAction: SemanticsPropertyKey<ImeAction> = AccessibilityKey<ImeAction>("ImeAction")
Selected
public val Selected: SemanticsPropertyKey<Boolean> = AccessibilityKey<Boolean>("Selected")
ToggleableState
public val ToggleableState: SemanticsPropertyKey<ToggleableState> =
AccessibilityKey<ToggleableState>("ToggleableState")
InputTextSuggestionState
public val InputTextSuggestionState: SemanticsPropertyKey<InputTextSuggestionState> =
AccessibilityKey<InputTextSuggestionState>("InputTextSuggestionState")
Password
public val Password: SemanticsPropertyKey<Unit> = AccessibilityKey<Unit>("Password")
Error
public val Error: SemanticsPropertyKey<String> = AccessibilityKey<String>("Error")
IndexForKey
public val IndexForKey: SemanticsPropertyKey<(Any) -> Int> =
SemanticsPropertyKey<(Any) -> Int>("IndexForKey")
IsEditable
public val IsEditable: SemanticsPropertyKey<Boolean> =
SemanticsPropertyKey<Boolean>("IsEditable")
MaxTextLength
public val MaxTextLength: SemanticsPropertyKey<Int> = SemanticsPropertyKey<Int>("MaxTextLength")
Shape
public val Shape: SemanticsPropertyKey<Shape> =
SemanticsPropertyKey<Shape>(
name = "Shape",
isImportantForAccessibility = false,
mergePolicy = { parentValue, _ ->
// Never merge shapes
parentValue
},
)