added in version 22.1.0
belongs to Maven artifact com.android.support:recyclerview-v7:28.0.0-alpha1

GridLayoutManager.DefaultSpanSizeLookup

public static final class GridLayoutManager.DefaultSpanSizeLookup
extends GridLayoutManager.SpanSizeLookup

java.lang.Object
   ↳ android.support.v7.widget.GridLayoutManager.SpanSizeLookup
     ↳ android.support.v7.widget.GridLayoutManager.DefaultSpanSizeLookup


Default implementation for GridLayoutManager.SpanSizeLookup. Each item occupies 1 span.

Summary

Public constructors

GridLayoutManager.DefaultSpanSizeLookup()

Public methods

int getSpanIndex(int position, int spanCount)

Returns the final span index of the provided position.

int getSpanSize(int position)

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

Inherited methods

From class android.support.v7.widget.GridLayoutManager.SpanSizeLookup
From class java.lang.Object

Public constructors

GridLayoutManager.DefaultSpanSizeLookup

added in version 22.1.0
GridLayoutManager.DefaultSpanSizeLookup ()

Public methods

getSpanIndex

added in version 22.1.0
int getSpanIndex (int position, 
                int spanCount)

Returns the final span index of the provided position.

If you have a faster way to calculate span index for your items, you should override this method. Otherwise, you should enable span index cache (setSpanIndexCacheEnabled(boolean)) for better performance. When caching is disabled, default implementation traverses all items from 0 to position. When caching is enabled, it calculat