From d4547a04dcde66d72659327dfaeeffc8c8dd71c8 Mon Sep 17 00:00:00 2001 From: Gian Sass Date: Tue, 18 Sep 2018 20:46:50 +0200 Subject: [PATCH] sort custom emojis alphabetically (#853) --- app/src/main/java/com/keylesspalace/tusky/ComposeActivity.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/src/main/java/com/keylesspalace/tusky/ComposeActivity.java b/app/src/main/java/com/keylesspalace/tusky/ComposeActivity.java index 8cbfb729..032dfe5c 100644 --- a/app/src/main/java/com/keylesspalace/tusky/ComposeActivity.java +++ b/app/src/main/java/com/keylesspalace/tusky/ComposeActivity.java @@ -126,6 +126,7 @@ import java.io.InputStream; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; +import java.util.Comparator; import java.util.Date; import java.util.Iterator; import java.util.List; @@ -303,6 +304,7 @@ public final class ComposeActivity @Override public void onResponse(@NonNull Call> call, @NonNull Response> response) { emojiList = response.body(); + Collections.sort(emojiList, (a, b) -> a.getShortcode().toLowerCase().compareTo(b.getShortcode().toLowerCase())); setEmojiList(emojiList); cacheInstanceMetadata(activeAccount); }