AccessibilityNodeInfoCompat.SelectionPositionCompat


public final class AccessibilityNodeInfoCompat.SelectionPositionCompat


Compat class for AccessibilityNodeInfo.SelectionPosition, which is a class that defines either the start or end of a selection that can span across multiple AccessibilityNodeInfo objects.

See also
AccessibilityNodeInfo.SelectionPosition

Compatibility:

  • API <: 36.1: Class methods perform no-op behavior.

Summary

Public constructors

SelectionPositionCompat(@NonNull SelectionPosition position)

Instantiates a new SelectionPositionCompat.

SelectionPositionCompat(
    @NonNull AccessibilityNodeInfoCompat node,
    int offset
)

Instantiates a new SelectionPositionCompat.

SelectionPositionCompat(@NonNull View view, int offset)

Instantiates a new SelectionPositionCompat.

SelectionPositionCompat(
    @NonNull View view,
    int virtualDescendantId,
    int offset
)

Instantiates a new SelectionPositionCompat.

Public methods

boolean
equals(Object other)

Compatibility:

@Nullable AccessibilityNodeInfoCompat
int
int

Compatibility:

Public constructors

SelectionPositionCompat

public SelectionPositionCompat(@NonNull SelectionPosition position)

Instantiates a new SelectionPositionCompat.

Parameters
@NonNull SelectionPosition position

The underlying SelectionPosition to wrap.

SelectionPositionCompat

public SelectionPositionCompat(
    @NonNull AccessibilityNodeInfoCompat node,
    int offset
)

Instantiates a new SelectionPositionCompat.

Parameters
@NonNull AccessibilityNodeInfoCompat node

The AccessibilityNodeInfoCompat for the node of this selection position.

int offset

The offset for a SelectionPositionCompat within view's text content, which should be a value between 0 and the length of view's text.

SelectionPositionCompat

public SelectionPositionCompat(@NonNull View view, int offset)

Instantiates a new SelectionPositionCompat.

Parameters
@NonNull View view

The View containing the text associated with this selection position.

int offset

The offset for a selection position within view's text content, which should be a value between 0 and the length of view's text.

SelectionPositionCompat

public SelectionPositionCompat(
    @NonNull View view,
    int virtualDescendantId,
    int offset
)

Instantiates a new SelectionPositionCompat.

Parameters
@NonNull View view

The view whose virtual descendant is associated with the selection position.

int virtualDescendantId

The ID of the virtual descendant within view's virtual subtree that contains the selection position.

int offset

The offset for a selection position within the virtual descendant's text content, which should be a value between 0 and the length of the descendant's text.

Public methods

equals

public boolean equals(Object other)

Compatibility:

  • API <: 36.1: Always returns false

getNode

public @Nullable AccessibilityNodeInfoCompat getNode()
Returns
@Nullable AccessibilityNodeInfoCompat

The node associated with thisSelectionPositionCompat Compatibility:

  • API <: 36.1: Always returns null

getOffset

public int getOffset()
Returns
int

A value from 0 to the length of getNode's content representing the offset of the SelectionPositionCompat Compatibility:

  • API <: 36.1: Always returns -1

hashCode

public int hashCode()

Compatibility:

  • API <: 36.1: Always returns 0