-
Notifications
You must be signed in to change notification settings - Fork 554
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
Add support for observing the current state of filtering #507
Comments
@magneticflux- thanks for the message. But what do you want to achieve? PS. In my demoApp I show the swipeRefresh to indicate the searching and the update. |
@davideas It appears that this is the code that triggers the SnackBar with the elapsed filtering time after a filter or refresh is completed:
While the method of checking I would ultimately like a way to listen to filter requests without any fast-fail optimizations, i.e. every |
@magneticflux-, if I understood well your intention is to separate the updates from the filter results having 2 callbacks respectively? However:
|
This enhancement will be part of #439, new feature to update empty Views. |
@davideas Thanks for the response! Unfortunately, I don't think your fix resolves my issue completely. The @Override
protected void onPostExecute(Void result) {
if (mNotifications != null) { // <-------------------- (Only true if items move)
//Execute post data
switch (what) {
case UPDATE:
// Notify all the changes
executeNotifications(Payload.CHANGE);
onPostUpdate();
break;
case FILTER:
// Notify all the changes
executeNotifications(Payload.FILTER);
onPostFilter(); // <-------------------- (Callback after a filter triggers)
break;
}
}
mFilterAsyncTask = null;
} To keep everything backwards-compatible, you could deprecate your listeners and instead expose |
@magneticflux- The progress bar should be visible every time user modifies the search text and hidden at the end of the process. Note that To use LiveData in this context, the adapter needs a deep change, since the base library should not depend by those objects. At the moment, there's a Livedata extension that is designed to receive model items from any repository and forward adapter items to the adapter, normally an updateDataSet should be invoked providing a new initial list. |
Since I have a large list with complex filtering rules, filtering operations may take a second or two to complete. I wish to show an indeterminate progress bar to indicate to users that the operation is indeed working, but there is no listener that is fired when the loading state changes. Currently, I set the progress bar to
View.VISIBLE
whenever I update or filter any data AND the adapter has search text, and set it toView.GONE
whenever the adapter'sOnUpdateListener
is triggered.The text was updated successfully, but these errors were encountered: