AccessibilityNodeInfoCompat.CollectionItemInfoCompat

Added in 1.1.0

public class AccessibilityNodeInfoCompat.CollectionItemInfoCompat


Class with information if a node is a collection item.

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

Nested types

Builder for creating CollectionItemInfoCompat objects.

Public methods

int

Gets the column index at which the item is located.

int

Gets the number of columns the item spans.

@Nullable String

Gets the column title at which the item is located.

int

Gets the row index at which the item is located.

int

Gets the number of rows the item spans.

@Nullable String

Gets the row title at which the item is located.

boolean

This method is deprecated.

Use isHeading

boolean

Gets if the collection item is selected.

static AccessibilityNodeInfoCompat.CollectionItemInfoCompat
obtain(
    int rowIndex,
    int rowSpan,
    int columnIndex,
    int columnSpan,
    boolean heading
)

Returns a cached instance if such is available otherwise a new one.

static AccessibilityNodeInfoCompat.CollectionItemInfoCompat
obtain(
    int rowIndex,
    int rowSpan,
    int columnIndex,
    int columnSpan,
    boolean heading,
    boolean selected
)

Returns a cached instance if such is available otherwise a new one.

Public methods

getColumnIndex

Added in 1.1.0
public int getColumnIndex()

Gets the column index at which the item is located.

Returns
int

The column index.

getColumnSpan

Added in 1.1.0
public int getColumnSpan()

Gets the number of columns the item spans.

Returns
int

The column span.

getColumnTitle

Added in 1.12.0
public @Nullable String getColumnTitle()

Gets the column title at which the item is located.

Returns
@Nullable String

The column title.

getRowIndex

Added in 1.1.0
public int getRowIndex()

Gets the row index at which the item is located.

Returns
int

The row index.

getRowSpan

Added in 1.1.0
public int getRowSpan()

Gets the number of rows the item spans.

Returns
int

The row span.

getRowTitle

Added in 1.12.0
public @Nullable String getRowTitle()

Gets the row title at which the item is located.

Returns
@Nullable String

The row title.

isHeading

Added in 1.1.0
Deprecated in 1.1.0
public boolean 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 1.1.0
public boolean isSelected()

Gets if the collection item is selected.

Returns
boolean

If the item is selected.

obtain

Added in 1.1.0
public static AccessibilityNodeInfoCompat.CollectionItemInfoCompat obtain(
    int rowIndex,
    int rowSpan,
    int columnIndex,
    int columnSpan,
    boolean heading
)

Returns a cached instance if such is available otherwise a new one.

Parameters
int rowIndex

The row index at which the item is located.

int rowSpan

The number of rows the item spans.

int columnIndex

The column index at which the item is located.

int columnSpan

The number of columns the item spans.

boolean heading

Whether the item is a heading. This should be set to false and the newer setHeading used to identify headings.

obtain

Added in 1.1.0
public static AccessibilityNodeInfoCompat.CollectionItemInfoCompat obtain(
    int rowIndex,
    int rowSpan,
    int columnIndex,
    int columnSpan,
    boolean heading,
    boolean selected
)

Returns a cached instance if such is available otherwise a new one.

Parameters
int rowIndex

The row index at which the item is located.

int rowSpan

The number of rows the item spans.

int columnIndex

The column index at which the item is located.

int columnSpan

The number of columns the item spans.

boolean heading

Whether the item is a heading. This should be set to false and the newer setHeading used to identify headings.

boolean selected

Whether the item is selected.