mirror of https://github.com/M66B/FairEmail.git
Simplified search reset
This commit is contained in:
parent
d788d75422
commit
877d1f1764
|
@ -112,8 +112,22 @@ public class BoundaryCallbackMessages extends PagedList.BoundaryCallback<TupleMe
|
||||||
}
|
}
|
||||||
|
|
||||||
State setCallback(IBoundaryCallbackMessages intf) {
|
State setCallback(IBoundaryCallbackMessages intf) {
|
||||||
|
Log.i("Boundary callback=" + intf);
|
||||||
|
if (Objects.equals(intf, this.intf))
|
||||||
|
return this.state;
|
||||||
|
|
||||||
this.intf = intf;
|
this.intf = intf;
|
||||||
this.state = new State();
|
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;
|
return this.state;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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
|
} else
|
||||||
loadMessagesNext(top);
|
loadMessagesNext(top);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue