Simplified search reset

This commit is contained in:
M66B 2021-06-18 16:50:09 +02:00
parent d788d75422
commit 877d1f1764
2 changed files with 14 additions and 19 deletions

View File

@ -112,8 +112,22 @@ public class BoundaryCallbackMessages extends PagedList.BoundaryCallback<TupleMe
}
State setCallback(IBoundaryCallbackMessages intf) {
Log.i("Boundary callback=" + intf);
if (Objects.equals(intf, this.intf))
return this.state;
this.intf = intf;
this.state = new State();
if (criteria != null)
executor.submit(new Runnable() {
@Override
public void run() {
Log.i("Boundary reset search");
DB.getInstance(context).message().resetSearch();
}
});
return this.state;
}

View File

@ -4822,25 +4822,6 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
}
}
});
} else if (viewType == AdapterMessage.ViewType.SEARCH && !reset) {
new SimpleTask<Void>() {
@Override
protected Void onExecute(Context context, Bundle args) {
DB.getInstance(context).message().resetSearch();
return null;
}
@Override
protected void onExecuted(Bundle args, Void data) {
reset = true;
loadMessagesNext(top);
}
@Override
protected void onException(Bundle args, Throwable ex) {
Log.unexpectedError(getParentFragmentManager(), ex);
}
}.execute(this, new Bundle(), "search:reset");
} else
loadMessagesNext(top);
}