From 41f81723f55c421e5479373bb97eac6733dfb0ea Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Sun, 1 Apr 2018 23:29:53 +0200 Subject: reorder and scroll down after resending a message --- .../de/pixart/messenger/entities/Conversation.java | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'src/main/java/de/pixart/messenger/entities') diff --git a/src/main/java/de/pixart/messenger/entities/Conversation.java b/src/main/java/de/pixart/messenger/entities/Conversation.java index b41805987..9a856a738 100644 --- a/src/main/java/de/pixart/messenger/entities/Conversation.java +++ b/src/main/java/de/pixart/messenger/entities/Conversation.java @@ -17,7 +17,6 @@ import org.json.JSONObject; import java.security.interfaces.DSAPublicKey; import java.util.ArrayList; import java.util.Collections; -import java.util.Comparator; import java.util.Iterator; import java.util.List; import java.util.ListIterator; @@ -1017,16 +1016,13 @@ public class Conversation extends AbstractEntity implements Blockable, Comparabl public void sort() { synchronized (this.messages) { - Collections.sort(this.messages, new Comparator() { - @Override - public int compare(Message left, Message right) { - if (left.getTimeSent() < right.getTimeSent()) { - return -1; - } else if (left.getTimeSent() > right.getTimeSent()) { - return 1; - } else { - return 0; - } + Collections.sort(this.messages, (left, right) -> { + if (left.getTimeSent() < right.getTimeSent()) { + return -1; + } else if (left.getTimeSent() > right.getTimeSent()) { + return 1; + } else { + return 0; } }); untieMessages(); -- cgit v1.2.3