mirror of
https://github.com/M66B/FairEmail.git
synced 2026-01-02 02:50:56 +01:00
Skip loading previous/next message
This commit is contained in:
@@ -263,29 +263,20 @@ public class ViewModelMessages extends ViewModel {
|
||||
for (int pos = 0; pos < messages.size(); pos++) {
|
||||
TupleMessageEx item = messages.get(pos);
|
||||
if (item != null && id == item.id) {
|
||||
boolean load = false;
|
||||
|
||||
if (pos - 1 >= 0) {
|
||||
TupleMessageEx next = messages.get(pos - 1);
|
||||
if (next == null)
|
||||
load = true;
|
||||
intf.onNext(true, next == null ? null : next.id);
|
||||
} else
|
||||
intf.onNext(false, null);
|
||||
|
||||
if (pos + 1 < messages.size()) {
|
||||
TupleMessageEx prev = messages.get(pos + 1);
|
||||
if (prev == null)
|
||||
load = true;
|
||||
intf.onPrevious(true, prev == null ? null : prev.id);
|
||||
} else
|
||||
intf.onPrevious(false, null);
|
||||
|
||||
intf.onFound(pos, messages.size());
|
||||
|
||||
if (load)
|
||||
messages.loadAround(pos);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user