StaggeredGridLayoutManager.LayoutParams


class StaggeredGridLayoutManager.LayoutParams : RecyclerView.LayoutParams


LayoutParams used by StaggeredGridLayoutManager.

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

Summary

Constants

const Int

Span Id for Views that are not laid out yet.

Public functions

Int

Returns the Span index to which this View is assigned.

Boolean

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

Unit
setFullSpan(fullSpan: Boolean)

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

Inherited Constants

From android.view.ViewGroup.LayoutParams
const Int

This property is deprecated.

const Int
const Int

Inherited functions

From androidx.recyclerview.widget.RecyclerView.LayoutParams
Int

Returns the up-to-date adapter position that the view this LayoutParams is attached to corresponds to in the RecyclerView.

Int

Returns the up-to-date adapter position that the view this LayoutParams is attached to corresponds to with respect to the Adapter that bound this View.

Int

This function is deprecated.

This method is confusing when nested adapters are used.

Int

Returns the adapter position that the view this LayoutParams is attached to corresponds to as of latest layout calculation.

Int

This function is deprecated.

use getViewLayoutPosition or getViewAdapterPosition

Boolean

Returns true if the adapter data item corresponding to the view this LayoutParams is attached to has been changed in the data set.

Boolean

Returns true if the adapter data item corresponding to the view this LayoutParams is attached to has been removed from the data set.

Boolean

Returns true if the view this LayoutParams is attached to is now representing potentially invalid data.

Boolean

Returns true if the view this LayoutParams is attached to needs to have its content updated from the corresponding adapter.

From android.view.ViewGroup.LayoutParams
Unit
setBaseAttributes(a: TypedArray!, widthAttr: Int, heightAttr: Int)
From android.view.ViewGroup.MarginLayoutParams

Constants

INVALID_SPAN_ID

Added in 1.0.0
const val INVALID_SPAN_ID = -1: Int

Span Id for Views that are not laid out yet.

Public constructors

LayoutParams

Added in 1.4.0-rc01
LayoutParams(source: RecyclerView.LayoutParams!)

LayoutParams

Added in 1.4.0-rc01
LayoutParams(source: ViewGroup.LayoutParams!)

LayoutParams

Added in 1.4.0-rc01
LayoutParams(source: ViewGroup.MarginLayoutParams!)

LayoutParams

Added in 1.4.0-rc01
LayoutParams(c: Context!, attrs: AttributeSet!)

LayoutParams

Added in 1.4.0-rc01
LayoutParams(width: Int, height: Int)

Public functions

getSpanIndex

Added in 1.0.0
fun getSpanIndex(): Int

Returns the Span index to which this View is assigned.

Returns
Int

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

isFullSpan

Added in 1.0.0
fun isFullSpan(): Boolean

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

Returns
Boolean

True if the View occupies all spans or false otherwise.

See also
setFullSpan

setFullSpan

Added in 1.0.0
fun setFullSpan(fullSpan: Boolean): Unit

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: Boolean

True if this item should traverse all spans.

See also
isFullSpan