-
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
Filtering original list in 2 modes: use the existent internal list or with user list #337
Comments
Unfortunately, it will brake the functionality of UNDO just after Filter and viceversa. Then it is too complicated to recalculate the correct position on the original Items too. |
I just stuck on it. This is exactly what I need. I need to allows users search in huge list for desired item by name and then allows to delete it, allows to undo the delete and still search. And this is really hard with the current implementation. Problem is that filtering now override original mItems list and all delete and undo is based on it. Filtering should not modify the original adapter data, there should be a copy just for display and until filtering is active every update of the original data should result in re-filtering all items and display filtered result again. |
I did quick and very ugly workaround working in my situation
|
@tprochazka, that is not good, better to delete all. With current snapshot, you can still filter > delete > undo until a new filter or an update occurs! For the moment what you need to provide is the original list, same as the one you initialized the adapter. I will evaluate if this issue can now be reopened. |
Yes. I know that I must provide original list, but the original list is affected by delete/undelete. So I create copy of the current items when filtering starts, then update it by delete items or restore it by undo and then after filtering is finished I delete it. Ideal would be when getCurrentItems() will return still the all items in the list and will be not affected by filtering. |
I see, the Adapter should help you in this case because:
How many times and how long you allow the user to undo after 3-5 changes of filter? |
@tprochazka, with the resolution of the issue #362, this issue is also resolved. |
I'm just testing it on the RC2. |
Initial internal list will be by default the original source list to filter items.
Alternatively, user can provide a new list from which the filter is applied (current mode).
The text was updated successfully, but these errors were encountered: