This is the way I call the ItemDecoration and the ItemDecoration it self.
....
itemListContainer.addItemDecoration(ItemDecoration())
....
class ItemDecoration() : RecyclerView.ItemDecoration() {
override fun onDraw(c: Canvas, parent: RecyclerView, state: RecyclerView.State) {
for (i in 0 until parent.childCount) {
val view = parent.getChildAt(i)
val childPos: Int = parent.getChildAdapterPosition(view)
}
}
}
I want to inflate item_header.xml within onDraw and show specific text in the TextView "item_title".
There is little to no recent information about this topic, the most topics are deprecated of incomplete.
Can somebody point me on the right direction for this.
I am already familiar with ViewTypes within Recyclerview but that is not what I am looking for at the moment.
Hi there,
I have a basic Recyclerview with some basic items.
There are some items where I want to add a header layout on top of it. The item_header.xml layout looks like this.
This is the way I call the ItemDecoration and the ItemDecoration it self.
I want to inflate item_header.xml within onDraw and show specific text in the TextView "item_title".
There is little to no recent information about this topic, the most topics are deprecated of incomplete. Can somebody point me on the right direction for this.
I am already familiar with ViewTypes within Recyclerview but that is not what I am looking for at the moment.
Thanks in advance