ListSpacingItemDecoration

An RecyclerView.ItemDecoration that adds spacing to the start or end of items in a list, specifically for items that represent categories.

This decoration is used to visually indent category items within a list, providing a clear visual hierarchy. It checks if the underlying data item is a CategoryViewData and applies a predefined spacing.

The spacing is applied to the left for LTR layouts and to the right for RTL layouts. Certain item types, identified by isIgnoreType, are excluded from this spacing.

Parameters

context

The context used to access resources, such as dimension values.

Constructors

Link copied to clipboard
constructor(context: Context)

Properties

Link copied to clipboard

Functions

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