recycler-view-divider / com.fondesa.recyclerviewdivider / BaseDividerItemDecoration / getItemOffsets

getItemOffsets

protected abstract fun getItemOffsets(layoutManager: LayoutManager, outRect: Rect, itemView: View, itemCount: Int, itemIndex: Int): Unit

Variation of RecyclerView.ItemDecoration.getItemOffsets which validates the RecyclerView before being notified.

Parameters

layoutManager - the RecyclerView.LayoutManager attached to the RecyclerView.

outRect - the Rect on which the offsets should be set.

itemView - the View of the cell which needs to get its offsets.

itemCount - the number of items in the adapter attached to the RecyclerView.

itemIndex - the index of the cell which needs to get its offsets.

See Also

RecyclerView.ItemDecoration.getItemOffsets

fun getItemOffsets(outRect: Rect, view: View, parent: RecyclerView, state: State): Unit
fun getItemOffsets(outRect: Rect, itemPosition: Int, parent: RecyclerView): Unit