public class

StaggeredGridLayoutManager.LayoutParams

extends RecyclerView.LayoutParams

 java.lang.Object

↳android.view.ViewGroup.MarginLayoutParams

androidx.recyclerview.widget.RecyclerView.LayoutParams

↳androidx.recyclerview.widget.StaggeredGridLayoutManager.LayoutParams

Overview

LayoutParams used by StaggeredGridLayoutManager.

Note that if the orientation is StaggeredGridLayoutManager.VERTICAL, the width parameter is ignored and if the orientation is StaggeredGridLayoutManager.HORIZONTAL the height parameter is ignored because child view is expected to fill all of the space given to it.

Summary

Fields
public static final intINVALID_SPAN_ID

Span Id for Views that are not laid out yet.

Constructors
publicLayoutParams(Context c, AttributeSet attrs)

publicLayoutParams(ViewGroup.LayoutParams source)

publicLayoutParams(ViewGroup.MarginLayoutParams source)

Methods
public final intgetSpanIndex()

Returns the Span index to which this View is assigned.

public booleanisFullSpan()

Returns whether this View occupies all available spans or just one.

public voidsetFullSpan(boolean fullSpan)

When set to true, the item will layout using all span area.

from RecyclerView.LayoutParamsgetAbsoluteAdapterPosition, getBindingAdapterPosition, getViewAdapterPosition, getViewLayoutPosition, getViewPosition, isItemChanged, isItemRemoved, isViewInvalid, viewNeedsUpdate
from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Fields

public static final int INVALID_SPAN_ID

Span Id for Views that are not laid out yet.

Constructors

public LayoutParams(Context c, AttributeSet attrs)

public LayoutParams(ViewGroup.MarginLayoutParams source)

public LayoutParams(ViewGroup.LayoutParams source)

Methods

public void setFullSpan(boolean fullSpan)

When set to true, the item will layout using all span area. That means, if orientation is vertical, the view will have full width; if orientation is horizontal, the view will have full height.

Parameters:

fullSpan: True if this item should traverse all spans.

See also: StaggeredGridLayoutManager.LayoutParams.isFullSpan()

public boolean isFullSpan()

Returns whether this View occupies all available spans or just one.

Returns:

True if the View occupies all spans or false otherwise.

See also: StaggeredGridLayoutManager.LayoutParams.setFullSpan(boolean)

public final int getSpanIndex()

Returns the Span index to which this View is assigned.

Returns:

The Span index of the View. If View is not yet assigned to any span, returns StaggeredGridLayoutManager.LayoutParams.INVALID_SPAN_ID.