From bd7cae3cffa5c4a9c4677bb1cce0222fdadf334f Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 26 Apr 2020 09:05:43 +0200 Subject: [PATCH] Skip loading previous/next message --- .../main/java/eu/faircode/email/ViewModelMessages.java | 9 --------- 1 file changed, 9 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/ViewModelMessages.java b/app/src/main/java/eu/faircode/email/ViewModelMessages.java index ca04c980fd..72848b5742 100644 --- a/app/src/main/java/eu/faircode/email/ViewModelMessages.java +++ b/app/src/main/java/eu/faircode/email/ViewModelMessages.java @@ -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; } }