StaggeredGridLayoutManager
open class StaggeredGridLayoutManager : RecyclerView.LayoutManager, RecyclerView.SmoothScroller.ScrollVectorProvider
kotlin.Any | ||
↳ | androidx.recyclerview.widget.RecyclerView.LayoutManager | |
↳ | androidx.recyclerview.widget.StaggeredGridLayoutManager |
A LayoutManager that lays out children in a staggered grid formation. It supports horizontal & vertical layout as well as an ability to layout children in reverse.
Staggered grids are likely to have gaps at the edges of the layout. To avoid these gaps, StaggeredGridLayoutManager can offset spans independently or move items between spans. You can control this behavior via setGapStrategy(int)
.
Summary
Nested classes | |
---|---|
open |
LayoutParams used by StaggeredGridLayoutManager. |
Constants | |
---|---|
static Int | |
static Int |
When scroll state is changed to |
static Int |
Does not do anything to hide gaps. |
static Int | |
static Int |
Public constructors | |
---|---|
<init>(context: Context!, attrs: AttributeSet!, defStyleAttr: Int, defStyleRes: Int) Constructor used when layout manager is set in XML by RecyclerView attribute "layoutManager". |
|
Creates a StaggeredGridLayoutManager with given parameters. |
Public methods | |
---|---|
open Unit |
assertNotInLayoutOrScroll(message: String!) |
open Boolean | |
open Boolean | |
open Boolean | |
open Int | |
open Int | |
open Int | |
open PointF? |
computeScrollVectorForPosition(targetPosition: Int) |
open Int | |
open Int | |
open Int | |
open IntArray! |
Returns the adapter position of the first completely visible view for each span. |
open IntArray! |
Returns the adapter position of the first visible view for each span. |
open IntArray! |
Returns the adapter position of the last completely visible view for each span. |
open IntArray! |
findLastVisibleItemPositions(into: IntArray!) Returns the adapter position of the last visible view for each span. |
open RecyclerView.LayoutParams! | |
open RecyclerView.LayoutParams! |
generateLayoutParams(c: Context!, attrs: AttributeSet!) |
open RecyclerView.LayoutParams! | |
open Int |
Returns the current gap handling strategy for StaggeredGridLayoutManager. |
open Int | |
open Boolean |
Returns whether views are laid out in reverse order or not. |
open Int |
Returns the number of spans laid out by StaggeredGridLayoutManager. |
open Unit |
For consistency, StaggeredGridLayoutManager keeps a mapping between spans and items. |
open Boolean | |
open Unit | |
open Unit | |
open Unit |
onAdapterChanged(@Nullable oldAdapter: RecyclerView.Adapter<RecyclerView.ViewHolder!>?, @Nullable newAdapter: RecyclerView.Adapter<RecyclerView.ViewHolder!>?) |
open Unit |
onDetachedFromWindow(view: RecyclerView!, recycler: RecyclerView.Recycler!) |
open View? |
onFocusSearchFailed(focused: View, direction: Int, recycler: RecyclerView.Recycler, state: RecyclerView.State) |
open Unit | |
open Unit |
onItemsAdded(recyclerView: RecyclerView, positionStart: Int, itemCount: Int) |
open Unit |
onItemsChanged(recyclerView: RecyclerView) |
open Unit |
onItemsMoved(recyclerView: RecyclerView, from: Int, to: Int, itemCount: Int) |
open Unit |
onItemsRemoved(recyclerView: RecyclerView, positionStart: Int, itemCount: Int) |
open Unit |
onItemsUpdated(recyclerView: RecyclerView, positionStart: Int, itemCount: Int, payload: Any?) |
open Unit |
onLayoutChildren(recycler: RecyclerView.Recycler!, state: RecyclerView.State!) |
open Unit |
onLayoutCompleted(state: RecyclerView.State!) |
open Unit |