AccessibilityNodeInfoCompat.SelectionCompat


public final class AccessibilityNodeInfoCompat.SelectionCompat


Compat class for AccessibilityNodeInfo.Selection, which is a class that represents a selection of content that may extend across more than one AccessibilityNodeInfo instance.

See also
AccessibilityNodeInfo.Selection

Compatibility:

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

Summary

Public constructors

SelectionCompat(@NonNull Bundle actionArguments)

Instantiates a new SelectionCompat from a Bundle of action arguments.

Instantiates a new SelectionCompat.

Instantiates a new SelectionCompat.

Public methods

boolean

Compatibility:

@Nullable AccessibilityNodeInfoCompat.SelectionPositionCompat
@Nullable AccessibilityNodeInfoCompat.SelectionPositionCompat
int

Compatibility:

@NonNull Bundle

Writes and returns a new Bundle that represents this SelectionCompat as action arguments.

@Nullable AccessibilityNodeInfo.Selection

Returns the underlying platform Selection object.

Public constructors

SelectionCompat

public SelectionCompat(@NonNull Bundle actionArguments)

Instantiates a new SelectionCompat from a Bundle of action arguments.

Applications or providers implementing performAction are expected to use this constructor to reconstruct the SelectionCompat from the arguments Bundle of an ACTION_SET_EXTENDED_SELECTION request.

Parameters
@NonNull Bundle actionArguments

The bundle containing the selection and offset types.

Throws
java.lang.IllegalArgumentException

If the bundle does not contain the required ACTION_ARGUMENT_SELECTION_PARCELABLE key or contains an invalid offset type.

SelectionCompat

Added in 1.18.0
public SelectionCompat(@Nullable AccessibilityNodeInfo.Selection selection)

Instantiates a new SelectionCompat.

Parameters
@Nullable AccessibilityNodeInfo.Selection selection

The underlying Selection to wrap.

SelectionCompat

Added in 1.18.0
public SelectionCompat(
    @NonNull AccessibilityNodeInfoCompat.SelectionPositionCompat start,
    @NonNull AccessibilityNodeInfoCompat.SelectionPositionCompat end
)

Instantiates a new SelectionCompat.

Parameters
@NonNull AccessibilityNodeInfoCompat.SelectionPositionCompat start

The start of the extended selection.

@NonNull AccessibilityNodeInfoCompat.SelectionPositionCompat end

The end of the extended selection.

Public methods

equals

public boolean equals(Object obj)

Compatibility:

  • API <: 36.1: Returns true if this object is identical to obj, else false

getEnd

Added in 1.18.0
public @Nullable AccessibilityNodeInfoCompat.SelectionPositionCompat getEnd()
Returns
@Nullable AccessibilityNodeInfoCompat.SelectionPositionCompat

The end of the extended selection. Compatibility:

  • API <: 36.1: Always returns null

getStart

Added in 1.18.0
public @Nullable AccessibilityNodeInfoCompat.SelectionPositionCompat getStart()
Returns
@Nullable AccessibilityNodeInfoCompat.SelectionPositionCompat

The start of the extended selection. Compatibility:

  • API <: 36.1: Always returns null

hashCode

public int hashCode()

Compatibility:

  • API <: 36.1: Always returns 0

toActionArguments

public @NonNull Bundle toActionArguments()

Writes and returns a new Bundle that represents this SelectionCompat as action arguments.

The returned Bundle is intended to be used directly by an accessibility service as the action arguments when performing the ACTION_SET_EXTENDED_SELECTION action.

Returns
@NonNull Bundle

A new Bundle representing this selection.

unwrap

Added in 1.19.0
public @Nullable AccessibilityNodeInfo.Selection unwrap()

Returns the underlying platform Selection object.

Returns
@Nullable AccessibilityNodeInfo.Selection

The platform Selection object, or null if the compat object was created on an API level lower than 36.1.