getSpanSizeForItemAt

open fun getSpanSizeForItemAt(position: Int, spanCount: Int?): Int?

Should return the span size for the item at position, when called from androidx.recyclerview.widget.GridLayoutManager will be the span size for the item at the position.

Otherwise if called from androidx.recyclerview.widget.StaggeredGridLayoutManager then spanCount may be null

Parameters

position

item position in the adapter

spanCount

current span count for the layout manager

See also