diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2016-02-04 16:29:17 +0100 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2016-02-04 16:29:17 +0100 |
commit | 28733e052ff1172a0b16ee8d52f1545b0ef32de3 (patch) | |
tree | c83f0c2fde2cea268551bc13abd6e5a80c44197f /src/main/java/eu/siacs/conversations/ui | |
parent | 4fdb0d92fe854126ad5201d56752716b9ab581b2 (diff) |
fixed performance regression in on scroll listener
Diffstat (limited to 'src/main/java/eu/siacs/conversations/ui')
-rw-r--r-- | src/main/java/eu/siacs/conversations/ui/ConversationFragment.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java index 42e442ed9..5874adae3 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java @@ -146,7 +146,12 @@ public class ConversationFragment extends Fragment implements EditMessage.Keyboa int visibleItemCount, int totalItemCount) { synchronized (ConversationFragment.this.messageList) { if (firstVisibleItem < 5 && messagesLoaded && messageList.size() > 0) { - long timestamp = ConversationFragment.this.messageList.get(0).getTimeSent(); + long timestamp; + if (messageList.get(0).getType() == Message.TYPE_STATUS && messageList.size() >= 2) { + timestamp = messageList.get(1).getTimeSent(); + } else { + timestamp = messageList.get(0).getTimeSent(); + } messagesLoaded = false; activity.xmppConnectionService.loadMoreMessages(conversation, timestamp, new XmppConnectionService.OnMoreMessagesLoaded() { @Override |