Merge pull request #932 from likeazir/emoji-performance

Limit autocompleted emojis to 50
This commit is contained in:
Gregory K 2024-11-18 00:52:57 +03:00 committed by GitHub
commit eae55c6e71
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 0 deletions

View File

@ -208,6 +208,7 @@ public class ComposeAutocompleteViewController{
.filter(e -> !startsWithSearch.contains(e))
.filter(e -> e.shortcode.toLowerCase().contains(_text.toLowerCase())))
.map(WrappedEmoji::new)
.limit(50)
.collect(Collectors.toList());
emptyButtonAdapter.setVisible(emojis.isEmpty());
UiUtils.updateList(oldList, emojis, list, emojisAdapter, (e1, e2)->e1.emoji.shortcode.equals(e2.emoji.shortcode));