Browse Source

Avoid drawing a header at position 0 if no header exists

merge-requests/382/head
Nicolas Pomepuy 7 years ago
committed by Geoffrey Métais
parent
commit
232a703b1c
  1. 10
      vlc-android/src/org/videolan/vlc/gui/view/RecyclerSectionItemDecoration.kt

10
vlc-android/src/org/videolan/vlc/gui/view/RecyclerSectionItemDecoration.kt

@ -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>()

Loading…
Cancel
Save