ListGroupItemsCollection

An interface for adapters that offer a list of ListGroupItem, separated by header or list items for each group within the list.

Types

Link copied to clipboard
data class ItemGroupInfo(val positionInGroup: Int?, val numberOfItemsInGroup: Int?)

ItemGroupInfo contains information about the group for a specific item.

Properties

Link copied to clipboard
abstract val items: List<T>

Header and content items.

Link copied to clipboard

Group information for each item position.

Functions

Link copied to clipboard

Calculates group information for all items.

Link copied to clipboard
open fun getNumberOfItemsInGroupOrNull(position: Int): Int?

Returns number of items in the group at position, or null if item is not a group member. If there are group member items in the list, the list is treated as one large group.

Link copied to clipboard
open fun getPositionInGroupOrNull(position: Int): Int?

Returns the position within a group of the item in itemsGroupInfo at position. Returns null if the item is not a group member.

Link copied to clipboard
open fun isGroupHeader(position: Int): Boolean

Indicates whether the item at position is a header of a group.

Link copied to clipboard
open fun isGroupMember(position: Int): Boolean

Indicates whether the item at position is a group member. A group consists of grid items, separated by header which are stuck to the top during scrolling or list items which are not stuck to the top during scrolling. An item is considered as a group member if it is a ItemType.GRID_ITEM.

Link copied to clipboard
open fun isNotLastListItemInGroup(position: Int): Boolean

Checks if the item at position is a list item and if it is not last within a group.