Added logging

This commit is contained in:
M66B 2021-02-13 13:55:32 +01:00
parent 0c6b5bf09c
commit ae8e139492
1 changed files with 3 additions and 0 deletions

View File

@ -274,15 +274,18 @@ public class ViewModelMessages extends ViewModel {
TupleMessageEx item = messages.get(pos);
if (item != null && id == item.id) {
fallback = true;
Log.i("Observe previous/next found id=" + id + " pos=" + pos);
if (pos - 1 >= 0) {
TupleMessageEx next = messages.get(pos - 1);
Log.i("Observe previous/next found id=" + id + " next=" + (next == null ? null : next.id));
intf.onNext(true, next == null ? null : next.id);
} else
intf.onNext(false, null);
if (pos + 1 < messages.size()) {
TupleMessageEx prev = messages.get(pos + 1);
Log.i("Observe previous/next found id=" + id + " prev=" + (prev == null ? null : prev.id));
intf.onPrevious(true, prev == null ? null : prev.id);
} else
intf.onPrevious(false, null);