added in version 22.1.0
belongs to Maven artifact


public static abstract class GridLayoutManager.SpanSizeLookup
extends Object

Known Direct Subclasses

A helper class to provide the number of spans each item occupies.

Default implementation sets each item to occupy exactly 1 span.


Public constructors


Public methods

int getSpanGroupIndex(int adapterPosition, int spanCount)

Returns the index of the group this position belongs.

int getSpanIndex(int position, int spanCount)

Returns the final span index of the provided position.

abstract int getSpanSize(int position)

Returns the number of span occupied by the item at position.

void invalidateSpanIndexCache()

Clears the span index cache.

boolean isSpanIndexCacheEnabled()

Returns whether results of getSpanIndex(int, int) method are cached or not.

void setSpanIndexCacheEnabled(boolean cacheSpanIndices)

Sets whether the results of getSpanIndex(int, int) method should be cached or not.

Inherited methods

From class java.lang.Object

Public constructors


added in version 22.1.0
GridLayoutManager.SpanSizeLookup ()

Public methods


added in version 22.1.0