added in API level 19

AccessibilityNodeInfo.CollectionItemInfo

public static final class AccessibilityNodeInfo.CollectionItemInfo
extends Object

java.lang.Object
   ↳ android.view.accessibility.AccessibilityNodeInfo.CollectionItemInfo


Class with information if a node is a collection item. Use obtain(int, int, int, int, boolean) to get an instance. Recycling is handled by the AccessibilityNodeInfo to which this object is attached.

A collection item is contained in a collection, it starts at a given row and column in the collection, and spans one or more rows and columns. For example, a header of two related table columns starts at the first row and the first column, spans one row and two columns.

Summary

Public methods

int getColumnIndex()

Gets the column index at which the item is located.

int getColumnSpan()

Gets the number of columns the item spans.

int getRowIndex()

Gets the row index at which the item is located.

int getRowSpan()

Gets the number of rows the item spans.

boolean isHeading()

This method was deprecated in API level P. Use isHeading()

boolean isSelected()

Gets if the collection item is selected.

static AccessibilityNodeInfo.CollectionItemInfo obtain(int rowIndex, int rowSpan, int columnIndex, int columnSpan, boolean heading)

Obtains a pooled instance.

static AccessibilityNodeInfo.CollectionItemInfo obtain(int rowIndex, int rowSpan, int columnIndex, int columnSpan, boolean heading, boolean selected)

Obtains a pooled instance.

Inherited methods

Public methods

getColumnIndex

added in API level 19
int getColumnIndex ()

Gets the column index at which the item is located.

Returns
int The column index.

getColumnSpan

added in API level 19
int getColumnSpan ()

Gets the number of columns the item spans.

Returns
int The column span.

getRowIndex

added in API level 19
int getRowIndex ()

Gets the row index at which the item is located.

Returns
int The row index.

getRowSpan

added in API level 19
int getRowSpan ()

Gets the number of rows the item spans.

Returns
int The row span.

isHeading

added in API level 19
boolean isHeading ()

This method was deprecated in API level P.
Use isHeading()

Gets if the collection item is a heading. For example, section heading, table header, etc.

Returns
boolean If the item is a heading.

isSelected

added in API level 21
boolean isSelected ()

Gets if the collection item is selected.

Returns
boolean If the item is selected.

obtain

added in API level 19
AccessibilityNodeInfo.CollectionItemInfo obtain (int rowIndex, 
                int rowSpan, 
                int columnIndex, 
                int columnSpan, 
                boolean heading)

Obtains a pooled instance.

Parameters
rowIndex int: The row index at which the item is located.

rowSpan int: The number of rows the item spans.

columnIndex int: The column index at which the item is located.

columnSpan int: The number of columns the item spans.

heading boolean: Whether the item is a heading. (Prefer setHeading(boolean)).

Returns
AccessibilityNodeInfo.CollectionItemInfo

obtain

added in API level 21
AccessibilityNodeInfo.CollectionItemInfo obtain (int rowIndex, 
                int rowSpan, 
                int columnIndex, 
                int columnSpan, 
                boolean heading, 
                boolean selected)

Obtains a pooled instance.

Parameters
rowIndex int: The row index at which the item is located.

rowSpan int: The number of rows the item spans.

columnIndex int: The column index at which the item is located.

columnSpan int: The number of columns the item spans.

heading boolean: Whether the item is a heading. (Prefer setHeading(boolean))

selected boolean: Whether the item is selected.

Returns
AccessibilityNodeInfo.CollectionItemInfo