# AccessibilityNodeInfoCompat.TouchDelegateInfoCompat

Artifact: [androidx.core:core](https://developer.android.com/jetpack/androidx/releases/core) [View Source](https://cs.android.com/search?q=file:androidx/core/view/accessibility/AccessibilityNodeInfoCompat.java+class:androidx.core.view.accessibility.AccessibilityNodeInfoCompat.TouchDelegateInfoCompat) Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/core#1.2.0)

*** ** * ** ***


```
public final class AccessibilityNodeInfoCompat.TouchDelegateInfoCompat
```

<br />

*** ** * ** ***

Class with information of touch delegated views and regions.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/core/view/accessibility/AccessibilityNodeInfoCompat.TouchDelegateInfoCompat#TouchDelegateInfoCompat(java.util.Map<android.graphics.Region,android.view.View>)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/Map.html<https://developer.android.com/reference/android/graphics/Region.html, https://developer.android.com/reference/android/view/View.html> targetMap)` Create a new instance of `https://developer.android.com/reference/androidx/core/view/accessibility/AccessibilityNodeInfoCompat.TouchDelegateInfoCompat`. |

| ### Public methods |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/graphics/Region.html` | `https://developer.android.com/reference/androidx/core/view/accessibility/AccessibilityNodeInfoCompat.TouchDelegateInfoCompat#getRegionAt(int)(@https://developer.android.com/reference/androidx/annotation/IntRange(from = 0) int index)` Return the `https://developer.android.com/reference/android/graphics/Region.html` at the given index. |
| `@https://developer.android.com/reference/androidx/annotation/IntRange(from = 0) int` | `https://developer.android.com/reference/androidx/core/view/accessibility/AccessibilityNodeInfoCompat.TouchDelegateInfoCompat#getRegionCount()()` Returns the number of touch delegate target region. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/core/view/accessibility/AccessibilityNodeInfoCompat` | `https://developer.android.com/reference/androidx/core/view/accessibility/AccessibilityNodeInfoCompat.TouchDelegateInfoCompat#getTargetForRegion(android.graphics.Region)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/graphics/Region.html region)` Return the target `https://developer.android.com/reference/androidx/core/view/accessibility/AccessibilityNodeInfoCompat` for the given `https://developer.android.com/reference/android/graphics/Region.html`. |

## Public constructors

### TouchDelegateInfoCompat

Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/core#1.2.0)

```
public TouchDelegateInfoCompat(@NonNull Map<Region, View> targetMap)
```

Create a new instance of `https://developer.android.com/reference/androidx/core/view/accessibility/AccessibilityNodeInfoCompat.TouchDelegateInfoCompat`.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/Map.html<https://developer.android.com/reference/android/graphics/Region.html, https://developer.android.com/reference/android/view/View.html> targetMap` | A map from regions (in view coordinates) to delegated views. |

## Public methods

### getRegionAt

Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/core#1.2.0)

```
public @Nullable Region getRegionAt(@IntRange(from = 0) int index)
```

Return the `https://developer.android.com/reference/android/graphics/Region.html` at the given index.

Compatibility:

- API \<29: Always returns `null`

| Parameters |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/IntRange(from = 0) int index` | The desired index, must be between 0 and `https://developer.android.com/reference/androidx/core/view/accessibility/AccessibilityNodeInfoCompat.TouchDelegateInfoCompat#getRegionCount()`-1. |

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/graphics/Region.html` | Returns the `https://developer.android.com/reference/android/graphics/Region.html` stored at the given index. |

### getRegionCount

Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/core#1.2.0)

```
public @IntRange(from = 0) int getRegionCount()
```

Returns the number of touch delegate target region.

Compatibility:

- API \<29: Always returns `0`

| Returns |
|---|---|
| `@https://developer.android.com/reference/androidx/annotation/IntRange(from = 0) int` | Number of touch delegate target region. |

### getTargetForRegion

Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/core#1.2.0)

```
public @Nullable AccessibilityNodeInfoCompat getTargetForRegion(@NonNull Region region)
```

Return the target `https://developer.android.com/reference/androidx/core/view/accessibility/AccessibilityNodeInfoCompat` for the given `https://developer.android.com/reference/android/graphics/Region.html`.

**Note:** This api can only be called from `https://developer.android.com/reference/android/accessibilityservice/AccessibilityService.html`.

Compatibility:

- API \<29: Always returns `null`

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/graphics/Region.html region` | The region retrieved from `https://developer.android.com/reference/androidx/core/view/accessibility/AccessibilityNodeInfoCompat.TouchDelegateInfoCompat#getRegionAt(int)`. |

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/core/view/accessibility/AccessibilityNodeInfoCompat` | The target node associates with the given region. |