GridItemSpacingDecoration
class GridItemSpacingDecoration( itemSpacingHorizontalPx: Int, itemSpacingVerticalPx: Int = itemSpacingHorizontalPx, applyRtl: Boolean = false) : RecyclerView.ItemDecoration
A RecyclerView.ItemDecoration used to add the spacing to items in the GridLayoutManager. When applyRtl, the start and end spacing are inverted.
Parameters
itemSpacingHorizontalPx
The horizontal spacing in pixels which is proportionally added to the left and the right, according to the item position.
itemSpacingVerticalPx
The vertical spacing in pixels which is added at the bottom of all grid items except the last row. The default value is the same as itemSpacingHorizontalPx.
applyRtl
When applyRtl
is true
, the start and end spacing inside the decoration will be inverted comparing to applyRtl
is false
.
Functions
Link copied to clipboard
open override fun getItemOffsets(outRect: Rect, view: View, parent: RecyclerView, state: RecyclerView.State)
Inherited functions
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun onDrawOver(@NonNull p0: Canvas, @NonNull p1: RecyclerView, @NonNull p2: RecyclerView.State)