Skip to content
Snippets Groups Projects
Commit 232a703b authored by Nicolas Pomepuy's avatar Nicolas Pomepuy Committed by Geoffrey Métais
Browse files

Avoid drawing a header at position 0 if no header exists

parent 9b93cca3
No related branches found
No related tags found
1 merge request!346Avoid drawing a header at position 0 if no header exists
Pipeline #11605 passed with stage
in 27 minutes and 52 seconds
......@@ -45,11 +45,13 @@ class RecyclerSectionItemDecoration(private val headerOffset: Int, private val s
if (sticky && previousChild != null) {
val position = parent.getChildAdapterPosition(previousChild)
val sectionPosition = provider.getPositionForSection(position)
previousSectionPosition = sectionPosition
if (provider.getHeaderForPostion(sectionPosition) != null) {
previousSectionPosition = sectionPosition
val title = provider.getSectionforPosition(sectionPosition)
header.text = title
drawHeader(c, parent.getChildAt(0), headerView)
val title = provider.getSectionforPosition(sectionPosition)
header.text = title
drawHeader(c, parent.getChildAt(0), headerView)
}
}
val drawnPositions = ArrayList<Int>()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment