AccessibilityNodeInfoCompat.TouchDelegateInfoCompat

Added in 1.2.0

public final class AccessibilityNodeInfoCompat.TouchDelegateInfoCompat


Class with information of touch delegated views and regions.

Summary

Public constructors

Create a new instance of TouchDelegateInfoCompat.

Public methods

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

Return the Region at the given index.

@IntRange(from = 0) int

Returns the number of touch delegate target region.

@Nullable AccessibilityNodeInfoCompat

Return the target AccessibilityNodeInfoCompat for the given Region.

Public constructors

TouchDelegateInfoCompat

Added in 1.2.0
public TouchDelegateInfoCompat(@NonNull Map<RegionView> targetMap)

Create a new instance of TouchDelegateInfoCompat.

Parameters
@NonNull Map<RegionView> targetMap

A map from regions (in view coordinates) to delegated views.

Public methods

getRegionAt

Added in 1.2.0
public @Nullable Region getRegionAt(@IntRange(from = 0) int index)

Return the Region at the given index.

Compatibility:

  • API <29: Always returns null
Parameters
@IntRange(from = 0) int index

The desired index, must be between 0 and getRegionCount-1.

Returns
@Nullable Region

Returns the Region stored at the given index.

getRegionCount

Added in 1.2.0
public @IntRange(from = 0) int getRegionCount()

Returns the number of touch delegate target region.

Compatibility:

  • API <29: Always returns 0
Returns
@IntRange(from = 0) int

Number of touch delegate target region.

getTargetForRegion

Added in 1.2.0
public @Nullable AccessibilityNodeInfoCompat getTargetForRegion(@NonNull Region region)

Return the target AccessibilityNodeInfoCompat for the given Region.

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

Compatibility:

  • API <29: Always returns null
Parameters
@NonNull Region region

The region retrieved from getRegionAt.

Returns
@Nullable AccessibilityNodeInfoCompat

The target node associates with the given region.