GridLayoutInfo

class GridLayoutInfo(gridLayoutManager: GridLayoutManager) : LayoutInfo

Constructors

Link copied to clipboard
constructor(context: Context?, spanCount: Int, orientation: Int = OrientationHelper.VERTICAL, reverseLayout: Boolean = false, allowGridMeasuresOverride: Boolean = false)
constructor(gridLayoutManager: GridLayoutManager)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open override fun approximateRangeSize(firstMeasuredItemWidth: Int, firstMeasuredItemHeight: Int, recyclerMeasuredWidth: Int, recyclerMeasuredHeight: Int): Int

This is called when the RecyclerBinder needs to calculate a range size. The returned value should be an approximate range size based on the size of the first measured item.

Link copied to clipboard
open override fun computeWrappedHeight(maxHeight: Int, componentTreeHolders: List<ComponentTreeHolder>): Int
Link copied to clipboard
open override fun createViewportFiller(measuredWidth: Int, measuredHeight: Int): LayoutInfo.ViewportFiller?
Link copied to clipboard
Link copied to clipboard
open override fun findFirstVisibleItemPosition(): Int
Link copied to clipboard
Link copied to clipboard
open override fun findLastVisibleItemPosition(): Int
Link copied to clipboard
open override fun getChildHeightSpec(heightSpec: Int, renderInfo: RenderInfo): Int
Link copied to clipboard
open override fun getChildWidthSpec(widthSpec: Int, renderInfo: RenderInfo): Int
Link copied to clipboard
open override fun getItemCount(): Int
Link copied to clipboard
Link copied to clipboard
open override fun getScrollDirection(): Int

This is the main scrolling direction that the LayoutManager passed to this binder will use.

Link copied to clipboard
open override fun scrollToPositionWithOffset(position: Int, offset: Int)

RecyclerBinder delegates scrolling responsibilities to the LayoutInfo, as the varied LayoutManagers wrapped by a LayoutInfo lack a common scrolling interface. Typical implementations should forward the call to the underlying LayoutManager's scrollToPositionWithOffset() or an equivalent.

Link copied to clipboard
open override fun setRenderInfoCollection(renderInfoCollection: LayoutInfo.RenderInfoCollection?)