AccessibilityNodeInfo.SelectionPosition.Builder


public static final class AccessibilityNodeInfo.SelectionPosition.Builder
extends Object

java.lang.Object
   ↳ android.view.accessibility.AccessibilityNodeInfo.SelectionPosition.Builder


Builder for creating SelectionPosition objects.

Summary

Public constructors

Builder(AccessibilityNodeInfo node, int offset)

Creates a new Builder.

Builder(View view, int offset)

Creates a new Builder.

Builder(View view, int virtualDescendantId, int offset)

Creates a new Builder.

Public methods

AccessibilityNodeInfo.SelectionPosition build()

Creates a new SelectionPosition instance.

AccessibilityNodeInfo.SelectionPosition.Builder setOffsetType(int offsetType)

Sets the offset type for the position.

Inherited methods

Public constructors

Builder

Added in version 37.2
public Builder (AccessibilityNodeInfo node, 
                int offset)

Creates a new Builder.

By default, the offset type is initialized to AccessibilityNodeInfo.SelectionPosition.OFFSET_TYPE_TEXT.

Parameters
node AccessibilityNodeInfo: The AccessibilityNodeInfo for the node of this position.
This value cannot be null.

offset int: The offset for the position.

Builder

Added in version 37.2
public Builder (View view, 
                int offset)

Creates a new Builder.

By default, the offset type is initialized to AccessibilityNodeInfo.SelectionPosition.OFFSET_TYPE_TEXT.

Parameters
view View: The View containing the text associated with this selection.
This value cannot be null.

offset int: The offset for the position.

Builder

Added in version 37.2
public Builder (View view, 
                int virtualDescendantId, 
                int offset)

Creates a new Builder.

By default, the offset type is initialized to AccessibilityNodeInfo.SelectionPosition.OFFSET_TYPE_TEXT.

Parameters
view View: The view whose virtual descendant is associated with the selection position.
This value cannot be null.

virtualDescendantId int: The virtual descendant id.

offset int: The offset for the position.

Public methods

build

Added in version 37.2
public AccessibilityNodeInfo.SelectionPosition build ()

Creates a new SelectionPosition instance.

Returns
AccessibilityNodeInfo.SelectionPosition This value cannot be null.

setOffsetType

Added in version 37.2
public AccessibilityNodeInfo.SelectionPosition.Builder setOffsetType (int offsetType)

Sets the offset type for the position.

Parameters
offsetType int: The scheme dictating how the offset should be interpreted.
Value is one of the following:
Returns
AccessibilityNodeInfo.SelectionPosition.Builder This builder.
This value cannot be null.