From 51fcb7de31f775c3d9f680e352c96f99b7874d8b Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Fri, 2 Mar 2018 11:21:42 +0100 Subject: [PATCH] scroll in post --- .../java/eu/siacs/conversations/ui/ConversationFragment.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java index cc7b2f795..05f16e82d 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java @@ -480,6 +480,7 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke private void setScrollPosition(ScrollState scrollPosition) { if (scrollPosition != null) { + //TODO maybe this needs a 'post' this.binding.messagesView.setSelectionFromTop(scrollPosition.position, scrollPosition.offset); } } @@ -1771,13 +1772,12 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke final int bottom = Math.max(0, this.messageList.size() - 1); final int pos; if (first == null) { - Log.d(Config.LOGTAG, "first unread message was null"); pos = bottom; } else { int i = getIndexOf(first.getUuid(), this.messageList); pos = i < 0 ? bottom : i; } - this.binding.messagesView.setSelection(pos); + this.binding.messagesView.post(() -> this.binding.messagesView.setSelection(pos)); } }