StickyHeaderDecoration
class StickyHeaderDecoration(isHeader: (itemPosition: Int) -> Boolean) : RecyclerView.ItemDecoration
A RecyclerView.ItemDecoration used to act as the sticky header in a RecyclerView.
Note:
Each RecyclerView should only have one instance of this class added. Adding multiple decorations has no effect and only impacts the performance.
In the current implementation, the background of the header item view can not be transparent. Also, if the parent RecyclerView has top padding,
android:clipToPadding
has to befalse
in order to draw this decoration properly.
Parameters
isHeader
Determines whether an item at the position is a header or not.
Constructors
Functions
Link copied to clipboard
open override fun getItemOffsets(outRect: Rect, view: View, parent: RecyclerView, state: RecyclerView.State)
Link copied to clipboard