@@ -45,17 +45,21 @@ public EmojiTextView(Context context, @Nullable AttributeSet attrs, int defStyle
45
45
* Checks if a Unicode codepoint is considered an emoji.
46
46
*/
47
47
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
55
59
}
56
60
57
61
/**
58
- * Returns true if the text (ignoring whitespace) consists solely of emojis.
62
+ * Returns true if the text (ignoring whitespace) is only emojis.
59
63
*/
60
64
private boolean isAllEmojis (CharSequence text ) {
61
65
if (text == null || text .length () == 0 ) return false ;
0 commit comments