StickyHeaderDecoration
class StickyHeaderDecoration(isHeader: (itemPosition: Int) -> Boolean) : RecyclerView.ItemDecoration
Content copied to clipboard
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)
Content copied to clipboard
Link copied to clipboard
open override fun onDrawOver(canvas: Canvas, parent: RecyclerView, state: RecyclerView.State)
Content copied to clipboard
Inherited functions
Link copied to clipboard
Content copied to clipboard
Link copied to clipboard
open fun onDraw(@NonNull p0: Canvas, @NonNull p1: RecyclerView, @NonNull p2: RecyclerView.State)
Content copied to clipboard
Link copied to clipboard