TtDividerItemDecoration

class TtDividerItemDecoration @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = R.attr.tt_divider_style, orientation: Int = VERTICAL) : RecyclerView.ItemDecoration

A divider used for RecyclerView.

Dividers are thin lines that separate content in a RecyclerView. A divider's orientation can be VERTICAL or HORIZONTAL. When the orientation is:

  • VERTICAL: the divider separates content in a vertical container. Hence the divider is drawn as a horizontal line.

  • HORIZONTAL: the divider separates content in a horizontal container. Hence the divider is drawn as a vertical line.

The default orientation of a divider is VERTICAL.

Parameters

context

The display context.

attrs

The attribute set provided in the layout XML file.

defStyleAttr

The default style attribute set.

orientation

The orientation of the divider.

Constructors

Link copied to clipboard
constructor(context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = R.attr.tt_divider_style, orientation: Int = VERTICAL)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The color of the divider.

Link copied to clipboard

Should the last item in the RecyclerView been decorated or not.

Link copied to clipboard

The end inset of the divider.

Link copied to clipboard

The start inset of the divider.

Link copied to clipboard

The orientation of the divider.

Link copied to clipboard

The thickness of the divider.

Functions

Link copied to clipboard
open override fun getItemOffsets(outRect: Rect, view: View, parent: RecyclerView, state: RecyclerView.State)
Link copied to clipboard
open override fun onDraw(c: Canvas, parent: RecyclerView, state: RecyclerView.State)

Inherited functions

Link copied to clipboard
open fun getItemOffsets(@NonNull p0: Rect, p1: Int, @NonNull p2: RecyclerView)
Link copied to clipboard
open fun onDraw(@NonNull p0: Canvas, @NonNull p1: RecyclerView)
Link copied to clipboard