API reference

ImportantForInteraction Interface

Specifies the importance of a composable for Gaze and Hands interaction.
Determines how the composable participates in user event handling by Gaze and Hands:

Signature

interface ImportantForInteraction

Companion Object

Properties

Auto : ImportantForInteraction
[Get]
Uses the default importance as determined by accessibility semantics.
An element is considered important for interaction if at least one of the following is true:
  • AccessibilityNodeInfo.isClickable
  • AccessibilityNodeInfo.isLongClickable
  • AccessibilityNodeInfo.isCheckable
  • AccessibilityNodeInfo.isContextClickable
  • AccessibilityNodeInfo.getRangeInfo returns non-null.
If all the above are false, the element is considered not important for interaction.
Note: The above will be true if the composable has any of the following modifiers:
  • Modifier.clickable
  • Modifier.combinedClickable
  • Modifier.toggleable
  • Modifier.triStateToggleable
  • Modifier.progressSemantics
or its Modifier.Modifier.semantics or Modifier.Modifier.clearAndSetSemantics has any of the following:
Signature
val Auto: ImportantForInteraction
No : ImportantForInteraction
[Get]
Hides the composable from gaze targeting.
Click handling is unaffected.
Signature
val No: ImportantForInteraction
Yes : ImportantForInteraction
[Get]
Marks the composable as a gaze target.
Occludes elements behind it from gaze targeting.
Signature
val Yes: ImportantForInteraction