> Documentation index: https://developer.android.com/reference/llms.txt

# AccessibilityNodeInfoCompat.SelectionPositionCompat.Builder

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core.md.txt) [View Source](https://cs.android.com/search?q=file:androidx/core/view/accessibility/AccessibilityNodeInfoCompat.java+class:androidx.core.view.accessibility.AccessibilityNodeInfoCompat.SelectionPositionCompat.Builder) Added in [1.20.0-alpha01](https://developer.android.com/jetpack/androidx/releases/core.md.txt#1.20.0-alpha01)

*** ** * ** ***


```
@PreviewAccessibilityApi
class AccessibilityNodeInfoCompat.SelectionPositionCompat.Builder
```

<br />

*** ** * ** ***

Builder for creating `SelectionPositionCompat` objects.

## Summary

| ### Public constructors |
|---|
| `Builder(node: AccessibilityNodeInfoCompat, offset: Int)` Creates a new Builder. |
| `Builder(view: View, offset: Int)` Creates a new Builder. |
| `Builder(view: View, virtualDescendantId: Int, offset: Int)` Creates a new Builder. |

| ### Public functions |
|---|---|
| `AccessibilityNodeInfoCompat.SelectionPositionCompat` | `build()` Creates a new `SelectionPositionCompat` instance. |
| `AccessibilityNodeInfoCompat.SelectionPositionCompat.Builder` | `setOffsetType(offsetType: Int)` Sets the offset type for the position. |

## Public constructors

### Builder

Added in [1.20.0-alpha01](https://developer.android.com/jetpack/androidx/releases/core.md.txt#1.20.0-alpha01)

```
Builder(node: AccessibilityNodeInfoCompat, offset: Int)
```

Creates a new Builder.

| Parameters |
|---|---|
| `node: AccessibilityNodeInfoCompat` | The `AccessibilityNodeInfoCompat` for the node of this position. |
| `offset: Int` | The offset for the position. |

### Builder

Added in [1.20.0-alpha01](https://developer.android.com/jetpack/androidx/releases/core.md.txt#1.20.0-alpha01)

```
Builder(view: View, offset: Int)
```

Creates a new Builder.

| Parameters |
|---|---|
| `view: View` | The `View` containing the text associated with this selection. |
| `offset: Int` | The offset for the position. |

### Builder

Added in [1.20.0-alpha01](https://developer.android.com/jetpack/androidx/releases/core.md.txt#1.20.0-alpha01)

```
Builder(view: View, virtualDescendantId: Int, offset: Int)
```

Creates a new Builder.

| Parameters |
|---|---|
| `view: View` | The view whose virtual descendant is associated with the selection position. |
| `virtualDescendantId: Int` | The virtual descendant id. |
| `offset: Int` | The offset for the position. |

## Public functions

### build

Added in [1.20.0-alpha01](https://developer.android.com/jetpack/androidx/releases/core.md.txt#1.20.0-alpha01)

```
fun build(): AccessibilityNodeInfoCompat.SelectionPositionCompat
```

Creates a new `SelectionPositionCompat` instance.

### setOffsetType

Added in [1.20.0-alpha01](https://developer.android.com/jetpack/androidx/releases/core.md.txt#1.20.0-alpha01)

```
fun setOffsetType(offsetType: Int): AccessibilityNodeInfoCompat.SelectionPositionCompat.Builder
```

Sets the offset type for the position.

| Parameters |
|---|---|
| `offsetType: Int` | The scheme dictating how the offset should be interpreted. |

| Returns |
|---|---|
| `AccessibilityNodeInfoCompat.SelectionPositionCompat.Builder` | This builder. |

| Throws |
|---|---|
| `java.lang.IllegalArgumentException` | If the `offsetType` is unknown. |