luizgrp / SectionedRecyclerViewAdapter

An Adapter that allows a RecyclerView to be split into Sections with headers and/or footers. Each Section can have its state controlled individually.
MIT License
1.68k stars 372 forks source link

Hide empty headers #130

Closed nugemon closed 6 years ago

nugemon commented 6 years ago

Hello,

Great library and I've got it working.

I'd like to know if there is any way to hide empty sections when using Filter(). I have so many categories in my application and when filtering with a SearchView I still need to scroll down since it is still showing all the headers.

I tried hiding the header from onBindHeaderViewHolder with: if(sectionItemsTotal == 1){ headerHolder.headerView.setVisibility(View.GONE); } It does hide the view, but leave an empty spot on the list so effectively the same result as showing the header.

nugemon commented 6 years ago

I was able to find out what I did wrong, sorry for opening this issue. Closing this

Fahad-pnw commented 5 years ago

could you guide how you got this one fixed? i'm having the same issue.