do not synchronize twice when adding status and date bubbles

This commit is contained in:
Daniel Gultsch 2019-04-27 15:24:37 +02:00
parent d8010d7a33
commit 7c35f28633
1 changed files with 89 additions and 97 deletions

View File

@ -2279,15 +2279,8 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke
this.binding.textSendButton.setImageResource(SendButtonTool.getSendButtonImageResource(getActivity(), action, status)); this.binding.textSendButton.setImageResource(SendButtonTool.getSendButtonImageResource(getActivity(), action, status));
} }
protected void updateDateSeparators() {
synchronized (this.messageList) {
DateSeparator.addAll(this.messageList);
}
}
protected void updateStatusMessages() { protected void updateStatusMessages() {
updateDateSeparators(); DateSeparator.addAll(this.messageList);
synchronized (this.messageList) {
if (showLoadMoreMessages(conversation)) { if (showLoadMoreMessages(conversation)) {
this.messageList.add(0, Message.createLoadMoreMessage(conversation)); this.messageList.add(0, Message.createLoadMoreMessage(conversation));
} }
@ -2384,7 +2377,6 @@ public class ConversationFragment extends XmppFragment implements EditMessage.Ke
} }
} }
}
private void stopScrolling() { private void stopScrolling() {
long now = SystemClock.uptimeMillis(); long now = SystemClock.uptimeMillis();