aboutsummaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authorlookshe <github@lookshe.org>2015-08-16 17:56:46 +0200
committerlookshe <github@lookshe.org>2015-08-16 17:56:46 +0200
commit3be4dbf66ae360e16e07a8a5da01c35f67e6ddfe (patch)
tree021457a52a7c1b412ab7115c223d1af055e7e5f2 /libs
parentea1debd8f72903bfbcc631713d803c27be433f20 (diff)
fixes FS#13 - Change smiley replacement patterns to be case insensitive
Diffstat (limited to 'libs')
-rw-r--r--libs/emojicon/src/main/java/github/ankushsachdeva/emojicon/EmojiconHandler.java52
1 files changed, 18 insertions, 34 deletions
diff --git a/libs/emojicon/src/main/java/github/ankushsachdeva/emojicon/EmojiconHandler.java b/libs/emojicon/src/main/java/github/ankushsachdeva/emojicon/EmojiconHandler.java
index 0df62b57..3e032c42 100644
--- a/libs/emojicon/src/main/java/github/ankushsachdeva/emojicon/EmojiconHandler.java
+++ b/libs/emojicon/src/main/java/github/ankushsachdeva/emojicon/EmojiconHandler.java
@@ -1406,48 +1406,32 @@ public final class EmojiconHandler {
.getInstance();
static {
- addPattern(ANDROID_EMOTICONS, ":)", R.drawable.emo_im_happy);
- addPattern(ANDROID_EMOTICONS, ":-)", R.drawable.emo_im_happy);
- addPattern(ANDROID_EMOTICONS, ":(", R.drawable.emo_im_sad);
- addPattern(ANDROID_EMOTICONS, ":-(", R.drawable.emo_im_sad);
- addPattern(ANDROID_EMOTICONS, ";)", R.drawable.emo_im_winking);
- addPattern(ANDROID_EMOTICONS, ";-)", R.drawable.emo_im_winking);
- addPattern(ANDROID_EMOTICONS, ":P",
+ addPattern(ANDROID_EMOTICONS, ":-?\\)", R.drawable.emo_im_happy);
+ addPattern(ANDROID_EMOTICONS, ":-?\\(", R.drawable.emo_im_sad);
+ addPattern(ANDROID_EMOTICONS, ";-?\\)", R.drawable.emo_im_winking);
+ addPattern(ANDROID_EMOTICONS, ":-?[pP]",
R.drawable.emo_im_tongue_sticking_out);
- addPattern(ANDROID_EMOTICONS, ":-P",
- R.drawable.emo_im_tongue_sticking_out);
- addPattern(ANDROID_EMOTICONS, "=-O", R.drawable.emo_im_surprised);
- addPattern(ANDROID_EMOTICONS, ":*", R.drawable.emo_im_kissing);
- addPattern(ANDROID_EMOTICONS, ":-*", R.drawable.emo_im_kissing);
- addPattern(ANDROID_EMOTICONS, ":O", R.drawable.emo_im_wtf);
- addPattern(ANDROID_EMOTICONS, ":-O", R.drawable.emo_im_wtf);
- addPattern(ANDROID_EMOTICONS, "B)", R.drawable.emo_im_cool);
- addPattern(ANDROID_EMOTICONS, "B-)", R.drawable.emo_im_cool);
- addPattern(ANDROID_EMOTICONS, "8)", R.drawable.emo_im_cool);
- addPattern(ANDROID_EMOTICONS, "8-)", R.drawable.emo_im_cool);
- addPattern(ANDROID_EMOTICONS, ":$", R.drawable.emo_im_money_mouth);
- addPattern(ANDROID_EMOTICONS, ":-$", R.drawable.emo_im_money_mouth);
- addPattern(ANDROID_EMOTICONS, ":-!", R.drawable.emo_im_foot_in_mouth);
- addPattern(ANDROID_EMOTICONS, ":-[", R.drawable.emo_im_embarrassed);
- addPattern(ANDROID_EMOTICONS, "O:)", R.drawable.emo_im_angel);
- addPattern(ANDROID_EMOTICONS, "O:-)", R.drawable.emo_im_angel);
- addPattern(ANDROID_EMOTICONS, ":\\", R.drawable.emo_im_undecided);
- addPattern(ANDROID_EMOTICONS, ":-\\", R.drawable.emo_im_undecided);
- addPattern(ANDROID_EMOTICONS, ":'(", R.drawable.emo_im_crying);
- addPattern(ANDROID_EMOTICONS, ":D", R.drawable.emo_im_laughing);
- addPattern(ANDROID_EMOTICONS, ":-D", R.drawable.emo_im_laughing);
+ addPattern(ANDROID_EMOTICONS, "=-[oO0]", R.drawable.emo_im_surprised);
+ addPattern(ANDROID_EMOTICONS, ":-?\\*", R.drawable.emo_im_kissing);
+ addPattern(ANDROID_EMOTICONS, ":-?[oO0]", R.drawable.emo_im_wtf);
+ addPattern(ANDROID_EMOTICONS, "[8B]-?\\)", R.drawable.emo_im_cool);
+ addPattern(ANDROID_EMOTICONS, ":-?\\$", R.drawable.emo_im_money_mouth);
+ addPattern(ANDROID_EMOTICONS, ":-?!", R.drawable.emo_im_foot_in_mouth);
+ addPattern(ANDROID_EMOTICONS, ":-?\\[", R.drawable.emo_im_embarrassed);
+ addPattern(ANDROID_EMOTICONS, "[oO0]:-?\\)", R.drawable.emo_im_angel);
+ addPattern(ANDROID_EMOTICONS, ":-?[\\\\/]", R.drawable.emo_im_undecided);
+ addPattern(ANDROID_EMOTICONS, ":'-?\\(", R.drawable.emo_im_crying);
+ addPattern(ANDROID_EMOTICONS, ":-?D", R.drawable.emo_im_laughing);
addPattern(ANDROID_EMOTICONS, "O_o", R.drawable.emo_im_wtf);
addPattern(ANDROID_EMOTICONS, "o_O", R.drawable.emo_im_wtf);
- addPattern(ANDROID_EMOTICONS, ">:O", R.drawable.emo_im_yelling);
- addPattern(ANDROID_EMOTICONS, ">:0", R.drawable.emo_im_yelling);
- addPattern(ANDROID_EMOTICONS, ":S", R.drawable.emo_im_lips_are_sealed);
- addPattern(ANDROID_EMOTICONS, ":-S", R.drawable.emo_im_lips_are_sealed);
+ addPattern(ANDROID_EMOTICONS, ">:[oO0]", R.drawable.emo_im_yelling);
+ addPattern(ANDROID_EMOTICONS, ":-?[sS]", R.drawable.emo_im_lips_are_sealed);
addPattern(ANDROID_EMOTICONS, "<3", R.drawable.emo_im_heart);
}
private static void addPattern(Map<Pattern, Integer> map, String smile,
int resource) {
- map.put(Pattern.compile(Pattern.quote(smile)), resource);
+ map.put(Pattern.compile(smile), resource);
}
private static boolean getSmiledText(Context context, Spannable spannable) {