LayoutParams

open class LayoutParams : RecyclerView.LayoutParams
kotlin.Any
   ↳ android.view.ViewGroup.LayoutParams
   ↳ android.view.ViewGroup.MarginLayoutParams
   ↳ androidx.recyclerview.widget.RecyclerView.LayoutParams
   ↳ androidx.recyclerview.widget.StaggeredGridLayoutManager.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
static Int

Span Id for Views that are not laid out yet.

Public constructors
<init>(c: Context!, attrs: AttributeSet!)

<init>(width: Int, height: Int)

<init>(source: LayoutParams!)

Public methods
open Boolean

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

open Unit
setFullSpan(fullSpan: Boolean)

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

Int

Returns the Span index to which this View is assigned.

Inherited functions

Constants

INVALID_SPAN_ID

static val INVALID_SPAN_ID: Int

Span Id for Views that are not laid out yet.

Value: -1

Public constructors

<init>

LayoutParams(c: Context!, attrs: AttributeSet!)

<init>

LayoutParams(width: Int, height: Int)

<init>

LayoutParams(source: MarginLayoutParams!)

<init>

LayoutParams(source: LayoutParams!)

<init>

LayoutParams(source: RecyclerView.LayoutParams!)

Public methods

isFullSpan

open fun isFullSpan(): Boolean

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

Return
Boolean: True if the View occupies all spans or false otherwise.

setFullSpan

open 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

getSpanIndex

fun getSpanIndex(): Int

Returns the Span index to which this View is assigned.

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