-
Notifications
You must be signed in to change notification settings - Fork 552
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
[Question] How to keep some items after canceling filter or search text returns empty? #198
Comments
Hi @davideas , I saw that when I cancel search filterItems on Item not call, data will restore but not include header so that have no these header. |
Just use it in header item to have effect you want: @OverRide |
I understand when item filter() function return false it will not apear (but when constraint is empty this function not call). because adapter.filterItem(data, delay), data not include header. why header will appear when constaint is empty ? |
data should contains headers and items , new Array, if you write empty constraint or clear search then |
there are some special header need add not same other element as ULSItem, LayoutItem (NO HeaderItem) in demo, it not filter and restore when cancel filter. |
@mdtuyen, I executed some tests. So, if I understood well, you want some items added when the filter is reset, after a search is cleared out? Currently the filter is asynchronously, it means that, it is executed after the caller method is completed. Indeed, if you add items or modify the adapter list, this is executed before the filter. The thread for the filter, with the unfiltered list, will overwrite any modification to the main list! Now some ideas:
I will restore this feature, I consider this as an enhancement. |
… modify the list just after the Asynchronous filter and update.
@mdtuyen, I published a new Snapshot with these 2 methods, can you try now? |
I custom some AbstractModelItem to make Header same your LayoutItem or ULSItem and put to recyclerview.
When search these item not filter so that them will disappear but I want to show them when I cancel search or clear search.
Please help me make it.
Thanks,
The text was updated successfully, but these errors were encountered: