Ignore whitespace when determining if we show jumbomoji.

This commit is contained in:
Greyson Parrelli 2019-07-15 16:02:51 -04:00
parent d636f37132
commit 34e8d5ac57

View file

@ -42,7 +42,9 @@ public class EmojiParser {
public @NonNull CandidateList findCandidates(@Nullable CharSequence text) {
List<Candidate> results = new LinkedList<>();
if (text == null) return new CandidateList(results, false);
if (text == null) {
return new CandidateList(results, false);
}
boolean allEmojis = text.length() > 0;
@ -61,11 +63,13 @@ public class EmojiParser {
results.add(new Candidate(i, emojiEnd, drawInfo));
i = emojiEnd - 1;
} else {
} else if (text.charAt(i) != ' '){
allEmojis = false;
}
}
allEmojis &= !results.isEmpty();
return new CandidateList(results, allEmojis);
}