getSpanGroupIndex

open fun getSpanGroupIndex(adapterPosition: Int, spanCount: Int): Int(source)

Returns the index of the group this position belongs.

If getOrientation is VERTICAL, this is a row value. If getOrientation is HORIZONTAL, this is a column value.

For example, if grid has 3 columns and each item occupies 1 span, span group index for item 1 will be 0, item 5 will be 1.

Return

The index of the span group including the item at the given adapter position

Parameters

adapterPosition

The position in adapter

spanCount

The total number of spans in the grid