abstract class BaseDividerItemDecoration : ItemDecoration
Base implementation of RecyclerView.ItemDecoration which provides some utilities methods. It also provides different implementations of getItemOffsets and onDraw.
asSpace - true if the divider should behave as a space.
BaseDividerItemDecoration(asSpace: Boolean)
Base implementation of RecyclerView.ItemDecoration which provides some utilities methods. It also provides different implementations of getItemOffsets and onDraw. |
fun addTo(recyclerView: RecyclerView): Unit
Adds this decoration to the given RecyclerView. If this decoration was already added to the given RecyclerView, it will be removed first. |
|
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. fun getItemOffsets(outRect: Rect, view: View, parent: RecyclerView, state: State): Unitfun getItemOffsets(outRect: Rect, itemPosition: Int, parent: RecyclerView): Unit |
|
abstract fun onDraw(canvas: Canvas, recyclerView: RecyclerView, layoutManager: LayoutManager, itemCount: Int): Unit
Variation of RecyclerView.ItemDecoration.onDraw which validates the RecyclerView before being notified. This method will be invoked only if the divider shouldn't behave as a space since, if it's a space, it shouldn't draw anything. fun onDraw(c: Canvas, parent: RecyclerView, state: State): Unitfun onDraw(c: Canvas, parent: RecyclerView): Unit |
|
fun removeFrom(recyclerView: RecyclerView): Unit
Removes this decoration from the given RecyclerView. |