davideas / FlexibleAdapter

Fast and versatile Adapter for RecyclerView which regroups several features into one library to considerably improve the user experience :-)
Apache License 2.0
3.55k stars 548 forks source link

Scrollable headers/footers behavior when filtering #681

Closed shymmq closed 5 years ago

shymmq commented 5 years ago

5.x | Scrollable Headers and Footers

Cannot be filtered because they are not part of the main list, but added separately at the initialization phase (basically, implementing IFilterable will be useless).

What does this mean exactly? Will the headers/footers remain in the list after filtering or not? Is it possible to modify this behavior? I'm trying to apply a search filter to main items, but leave the scrollable header untouched. Unfortunately, the header always disappears when i use filterItems().

I tried overriding filterObject() with this: override fun filterObject(item: GenericItem?, constraint: Serializable?) = if (isScrollableHeaderOrFooter(item)) true else super.filterObject(item, constraint) but it doesn't seem to affect the behavior.

Is there any way around this?

davideas commented 5 years ago

@shymmq, I'm sorry but it is not possible for how it is designed. It is in more parts of the code. It could be done in the future, but I have no plan/time for it now.