# AccessibilityNodeInfoCompat.TouchDelegateInfoCompat

# 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)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/core/view/accessibility/AccessibilityNodeInfoCompat.TouchDelegateInfoCompat "View this page in Java")

<br />

```
class AccessibilityNodeInfoCompat.TouchDelegateInfoCompat
```

<br />

*** ** * ** ***

Class with information of touch delegated views and regions.

## Summary

|                                                                                                                                                                                                                                                                                                                                                                                                ### Public constructors                                                                                                                                                                                                                                                                                                                                                                                                |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [TouchDelegateInfoCompat](https://developer.android.com/reference/kotlin/androidx/core/view/accessibility/AccessibilityNodeInfoCompat.TouchDelegateInfoCompat#TouchDelegateInfoCompat(java.util.Map<android.graphics.Region,android.view.View>))`(targetMap: (`[Mutable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-map/index.html)`)`[Map](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html)`<`[Region](https://developer.android.com/reference/android/graphics/Region.html)`!, `[View](https://developer.android.com/reference/android/view/View.html)`!>)` Create a new instance of[TouchDelegateInfoCompat](https://developer.android.com/reference/kotlin/androidx/core/view/accessibility/AccessibilityNodeInfoCompat.TouchDelegateInfoCompat). |

|                                                                                ### Public functions                                                                                |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Region](https://developer.android.com/reference/android/graphics/Region.html)`?`                                                                                                  | [getRegionAt](https://developer.android.com/reference/kotlin/androidx/core/view/accessibility/AccessibilityNodeInfoCompat.TouchDelegateInfoCompat#getRegionAt(int))`(index: @`[IntRange](https://developer.android.com/reference/kotlin/androidx/annotation/IntRange)`(from = 0) `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`)` Return the[Region](https://developer.android.com/reference/android/graphics/Region.html)at the given index.                                                                              |
| `@`[IntRange](https://developer.android.com/reference/kotlin/androidx/annotation/IntRange)`(from = 0) `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [getRegionCount](https://developer.android.com/reference/kotlin/androidx/core/view/accessibility/AccessibilityNodeInfoCompat.TouchDelegateInfoCompat#getRegionCount())`()` Returns the number of touch delegate target region.                                                                                                                                                                                                                                                                                                                            |
| [AccessibilityNodeInfoCompat](https://developer.android.com/reference/kotlin/androidx/core/view/accessibility/AccessibilityNodeInfoCompat)`?`                                      | [getTargetForRegion](https://developer.android.com/reference/kotlin/androidx/core/view/accessibility/AccessibilityNodeInfoCompat.TouchDelegateInfoCompat#getTargetForRegion(android.graphics.Region))`(region: `[Region](https://developer.android.com/reference/android/graphics/Region.html)`)` Return the target[AccessibilityNodeInfoCompat](https://developer.android.com/reference/kotlin/androidx/core/view/accessibility/AccessibilityNodeInfoCompat)for the given[Region](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)  

```
TouchDelegateInfoCompat(targetMap: (Mutable)Map<Region!, View!>)
```

Create a new instance of[TouchDelegateInfoCompat](https://developer.android.com/reference/kotlin/androidx/core/view/accessibility/AccessibilityNodeInfoCompat.TouchDelegateInfoCompat).  

|                                                                                                                                                                                 Parameters                                                                                                                                                                                  |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------|
| `targetMap: (`[Mutable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-map/index.html)`)`[Map](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html)`<`[Region](https://developer.android.com/reference/android/graphics/Region.html)`!, `[View](https://developer.android.com/reference/android/view/View.html)`!>` | A map from regions (in view coordinates) to delegated views. |

## Public functions

### getRegionAt

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

```
fun getRegionAt(index: @IntRange(from = 0) Int): Region?
```

Return the[Region](https://developer.android.com/reference/android/graphics/Region.html)at the given index.

Compatibility:

- API \<29: Always returns`null`

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

|                                      Returns                                      |
|-----------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------|
| [Region](https://developer.android.com/reference/android/graphics/Region.html)`?` | Returns the[Region](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)  

```
fun getRegionCount(): @IntRange(from = 0) Int
```

Returns the number of touch delegate target region.

Compatibility:

- API \<29: Always returns`0`

|                                                                                      Returns                                                                                       |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------|
| `@`[IntRange](https://developer.android.com/reference/kotlin/androidx/annotation/IntRange)`(from = 0) `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | Number of touch delegate target region. |

### getTargetForRegion

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

```
fun getTargetForRegion(region: Region): AccessibilityNodeInfoCompat?
```

Return the target[AccessibilityNodeInfoCompat](https://developer.android.com/reference/kotlin/androidx/core/view/accessibility/AccessibilityNodeInfoCompat)for the given[Region](https://developer.android.com/reference/android/graphics/Region.html).

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

Compatibility:

- API \<29: Always returns`null`

|                                        Parameters                                        |
|------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `region: `[Region](https://developer.android.com/reference/android/graphics/Region.html) | The region retrieved from[getRegionAt](https://developer.android.com/reference/kotlin/androidx/core/view/accessibility/AccessibilityNodeInfoCompat.TouchDelegateInfoCompat#getRegionAt(int)). |

|                                                                    Returns                                                                    |
|-----------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------|
| [AccessibilityNodeInfoCompat](https://developer.android.com/reference/kotlin/androidx/core/view/accessibility/AccessibilityNodeInfoCompat)`?` | The target node associates with the given region. |