TouchDelegateInfoCompat

class TouchDelegateInfoCompat
kotlin.Any
   ↳ androidx.core.view.accessibility.AccessibilityNodeInfoCompat.TouchDelegateInfoCompat

Class with information of touch delegated views and regions.

Summary

Public constructors

<init>(@NonNull targetMap: MutableMap<Region!, View!>)

Create a new instance of TouchDelegateInfoCompat.

Public methods

Region?
getRegionAt(index: Int)

Return the Region at the given index.

Int

Returns the number of touch delegate target region.

AccessibilityNodeInfoCompat?
getTargetForRegion(@NonNull region: Region)

Return the target AccessibilityNodeInfoCompat for the given Region.

Public constructors

<init>

TouchDelegateInfoCompat(@NonNull targetMap: MutableMap<Region!, View!>)

Create a new instance of TouchDelegateInfoCompat.

Parameters
targetMap MutableMap<Region!, View!>: A map from regions (in view coordinates) to delegated views.

Public methods

getRegionAt

@Nullable fun getRegionAt(index: Int): Region?

Return the Region at the given index.

Compatibility:

  • API < 29: Always returns null
Parameters
index Int: The desired index, must be between 0 and getRegionCount()-1.
Return
Region?: Returns the Region stored at the given index.

getRegionCount

fun getRegionCount(): Int

Returns the number of touch delegate target region.

Compatibility:

  • API < 29: Always returns 0
Return
Int: Number of touch delegate target region.

getTargetForRegion

@Nullable fun getTargetForRegion(@NonNull region: Region): AccessibilityNodeInfoCompat?

Return the target AccessibilityNodeInfoCompat for the given Region.

Note: This api can only be called from android.accessibilityservice.AccessibilityService.

Note: It is a client responsibility to recycle the received info by calling AccessibilityNodeInfo#recycle() to avoid creating of multiple instances.

Compatibility:

  • API < 29: Always returns null
Parameters
region Region: The region retrieved from getRegionAt(int).
Return
AccessibilityNodeInfoCompat?: The target node associates with the given region.