Android Dev Summit, October 23-24: two days of technical content, directly from the Android team. Sign-up for livestream updates.

CollectionInfoCompat

open class CollectionInfoCompat
kotlin.Any
   ↳ androidx.core.view.accessibility.AccessibilityNodeInfoCompat.CollectionInfoCompat

Class with information if a node is a collection.

A collection of items has rows and columns and may be hierarchical. For example, a horizontal list is a collection with one column, as many rows as the list items, and is not hierarchical; A table is a collection with several rows, several columns, and is not hierarchical; A vertical tree is a hierarchical collection with one column and as many rows as the first level children.

Summary

Constants

static Int

Selection mode where multiple items may be selected.

static Int

Selection mode where items are not selectable.

static Int

Selection mode where a single item may be selected.

Public methods

open Int

Gets the number of columns.

open Int

Gets the number of rows.

open Int

Gets the collection's selection mode.

open Boolean

Gets if the collection is a hierarchically ordered.

open static AccessibilityNodeInfoCompat.CollectionInfoCompat!
obtain(rowCount: Int, columnCount: Int, hierarchical: Boolean, selectionMode: Int)

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

open static AccessibilityNodeInfoCompat.CollectionInfoCompat!
obtain(rowCount: Int, columnCount: Int, hierarchical: Boolean)

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

Constants

SELECTION_MODE_MULTIPLE

static val SELECTION_MODE_MULTIPLE: Int

Selection mode where multiple items may be selected.

Value: 2

SELECTION_MODE_NONE

static val SELECTION_MODE_NONE: Int

Selection mode where items are not selectable.

Value: 0

SELECTION_MODE_SINGLE

static val SELECTION_MODE_SINGLE: Int

Selection mode where a single item may be selected.

Value: 1

Public methods

getColumnCount

open fun getColumnCount(): Int

Gets the number of columns.

Return
Int: The column count.

getRowCount

open fun getRowCount(): Int

Gets the number of rows.

Return
Int: The row count.

getSelectionMode

open fun getSelectionMode(): Int

Gets the collection's selection mode.

Return
Int: The collection's selection mode, one of:

isHierarchical

open fun isHierarchical(): Boolean

Gets if the collection is a hierarchically ordered.

Return
Boolean: Whether the collection is hierarchical.

obtain

open static fun obtain(rowCount: Int, columnCount: Int, hierarchical: Boolean, selectionMode: Int): AccessibilityNodeInfoCompat.CollectionInfoCompat!

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

Parameters
rowCount Int: The number of rows.
columnCount Int: The number of columns.
hierarchical Int: Whether the collection is hierarchical.
selectionMode Int: The collection's selection mode, one of:
Return
AccessibilityNodeInfoCompat.CollectionInfoCompat!: An instance.

obtain

open static fun obtain(rowCount: Int, columnCount: Int, hierarchical: Boolean): AccessibilityNodeInfoCompat.CollectionInfoCompat!

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

Parameters
rowCount Int: The number of rows.
columnCount Int: The number of columns.
hierarchical Int: Whether the collection is hierarchical.
Return
AccessibilityNodeInfoCompat.CollectionInfoCompat!: An instance.