GridLayoutManager

public class GridLayoutManager
extends LinearLayoutManager

java.lang.Object
   ↳ androidx.recyclerview.widget.RecyclerView.LayoutManager
     ↳ androidx.recyclerview.widget.LinearLayoutManager
       ↳ androidx.recyclerview.widget.GridLayoutManager


A RecyclerView.LayoutManager implementations that lays out items in a grid.

By default, each item occupies 1 span. You can change it by providing a custom GridLayoutManager.SpanSizeLookup instance via setSpanSizeLookup(SpanSizeLookup).

Summary

Nested classes

class GridLayoutManager.DefaultSpanSizeLookup

Default implementation for GridLayoutManager.SpanSizeLookup

class GridLayoutManager.LayoutParams

LayoutParams used by GridLayoutManager. 

class GridLayoutManager.SpanSizeLookup

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

Constants

int DEFAULT_SPAN_COUNT

Inherited constants

Public constructors

GridLayoutManager(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)

Constructor used when layout manager is set in XML by RecyclerView attribute "layoutManager".

GridLayoutManager(Context context, int spanCount)

Creates a vertical GridLayoutManager

GridLayoutManager(Context context, int spanCount, int orientation, boolean reverseLayout)

Public m