Load around selected item

This commit is contained in:
M66B 2019-01-26 11:56:23 +00:00
parent 19ed92c5a5
commit 0f9371f9ed
1 changed files with 6 additions and 3 deletions

View File

@ -95,14 +95,17 @@ public class ViewModelMessages extends ViewModel {
continue;
if (found) {
prev = item;
list.getValue().loadAround(i);
break;
}
if (thread.equals(item.thread))
if (thread.equals(item.thread)) {
found = true;
else
list.getValue().loadAround(i);
} else
next = item;
}
if (!found)
return new Target[]{null, null};
return new Target[]{
prev == null ? null : new Target(prev.account, prev.thread, prev.id, prev.ui_found),
next == null ? null : new Target(next.account, next.thread, next.id, next.ui_found)};