Skip to content

Commit d39fed0

Browse files
committed
More emoji pick ups
1 parent fd51d7e commit d39fed0

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

app/src/main/java/org/thoughtcrime/securesms/components/emoji/EmojiTextView.java

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,21 @@ public EmojiTextView(Context context, @Nullable AttributeSet attrs, int defStyle
4545
* Checks if a Unicode codepoint is considered an emoji.
4646
*/
4747
private boolean isEmoji(int codePoint) {
48-
return (codePoint >= 0x1F600 && codePoint <= 0x1F64F) // Emoticons
49-
|| (codePoint >= 0x1F300 && codePoint <= 0x1F5FF) // Misc Symbols and Pictographs
50-
|| (codePoint >= 0x1F680 && codePoint <= 0x1F6FF) // Transport & Map Symbols
51-
|| (codePoint >= 0x2600 && codePoint <= 0x26FF) // Misc symbols
52-
|| (codePoint >= 0x2700 && codePoint <= 0x27BF) // Dingbats
53-
|| (codePoint >= 0x1F900 && codePoint <= 0x1F9FF) // Supplemental Symbols and Pictographs
54-
|| (codePoint >= 0x1F1E6 && codePoint <= 0x1F1FF); // Regional indicator symbols (flags)
48+
return (codePoint >= 0x1F000 && codePoint <= 0x1FFFF) || // Most emojis live here
49+
(codePoint >= 0x2000 && codePoint <= 0x2BFF) || // Includes arrows, symbols
50+
(codePoint >= 0x2300 && codePoint <= 0x23FF) || // Technical misc
51+
(codePoint >= 0x2600 && codePoint <= 0x27EF) || // Dingbats, misc symbols
52+
(codePoint >= 0x2900 && codePoint <= 0x297F) || // Supplemental arrows
53+
(codePoint >= 0x2B00 && codePoint <= 0x2BFF) || // More symbols
54+
(codePoint >= 0x3000 && codePoint <= 0x303F) || // CJK symbols
55+
(codePoint >= 0x3200 && codePoint <= 0x32FF) || // Enclosed CJK
56+
(codePoint >= 0xFE00 && codePoint <= 0xFE0F) || // Variation selectors
57+
(codePoint >= 0x1F900 && codePoint <= 0x1F9FF) || // Supplemental symbols
58+
(codePoint >= 0x1FA70 && codePoint <= 0x1FAFF); // Extended symbols
5559
}
5660

5761
/**
58-
* Returns true if the text (ignoring whitespace) consists solely of emojis.
62+
* Returns true if the text (ignoring whitespace) is only emojis.
5963
*/
6064
private boolean isAllEmojis(CharSequence text) {
6165
if (text == null || text.length() == 0) return false;

0 commit comments

Comments
 (0)