Ignore whitespace when determining if we show jumbomoji.
This commit is contained in:
parent
d636f37132
commit
34e8d5ac57
1 changed files with 6 additions and 2 deletions
|
@ -42,7 +42,9 @@ public class EmojiParser {
|
||||||
public @NonNull CandidateList findCandidates(@Nullable CharSequence text) {
|
public @NonNull CandidateList findCandidates(@Nullable CharSequence text) {
|
||||||
List<Candidate> results = new LinkedList<>();
|
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;
|
boolean allEmojis = text.length() > 0;
|
||||||
|
|
||||||
|
@ -61,11 +63,13 @@ public class EmojiParser {
|
||||||
results.add(new Candidate(i, emojiEnd, drawInfo));
|
results.add(new Candidate(i, emojiEnd, drawInfo));
|
||||||
|
|
||||||
i = emojiEnd - 1;
|
i = emojiEnd - 1;
|
||||||
} else {
|
} else if (text.charAt(i) != ' '){
|
||||||
allEmojis = false;
|
allEmojis = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
allEmojis &= !results.isEmpty();
|
||||||
|
|
||||||
return new CandidateList(results, allEmojis);
|
return new CandidateList(results, allEmojis);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue