Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to keep the sticky header after filter items? #73

Closed
LuckHard opened this issue Apr 25, 2016 · 3 comments
Closed

How to keep the sticky header after filter items? #73

LuckHard opened this issue Apr 25, 2016 · 3 comments

Comments

@LuckHard
Copy link

Hi davideas.

Thank you for creating this project.
I have some problems. Can you help me?
I want to keep the header after filter items (when empty result),how can i do?
In addition, may I have the results of the list before filter items?

Thanks.

davideas added a commit that referenced this issue Apr 25, 2016
…ep header also if a subItem has been filtered #73.
@davideas
Copy link
Owner

Hello @LuckHard, I've added the functionality for header and items with header. I've committed something, I think it is not exactly what you are looking for when headers are sticky.
I have to disable the sticky headers during the search because the way how it is implemented (FrameLayout holding the itemView) at the RecyclerView doesn't like: Two different ViewHolders have the same change ID. This might happen due to inconsistent Adapter update events or if the LayoutManager lays out the same View multiple times. Which means no sticky when filter is active.

I will however add the other improvement in the next SNAPSHOT release or in next pre-release when I am ready.

Regarding the possibility to have the results before the filter items, the only way to do it, is to duplicate the list as I suggested in the wiki: You have to pass a copy to the Adapter when you instantiate it, while during filter you have to pass the original list.
This is necessary because when user removes a character from the search text, the filter engine must search again from the bigger original list.

@davideas
Copy link
Owner

davideas commented May 1, 2016

The implemented feature in available in v5.0.0-b6.

@davideas davideas closed this as completed May 1, 2016
@LuckHard
Copy link
Author

LuckHard commented May 3, 2016

I'm sorry so long to reply. I tested it, it seems to work well,thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants