mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-11-28 12:56:49 +01:00
Merge remote-tracking branch 'github/pr/1424'
This commit is contained in:
commit
373e38eace
@ -1,5 +1,5 @@
|
|||||||
/* Copyright (C) 2015-2019 Andreas Shimokawa, Carsten Pfeiffer, Daniele
|
/* Copyright (C) 2015-2019 Andreas Shimokawa, Carsten Pfeiffer, Daniele
|
||||||
Gobbetti, Matthieu Baerts
|
Gobbetti, Matthieu Baerts, Taavi Eomäe
|
||||||
|
|
||||||
This file is part of Gadgetbridge.
|
This file is part of Gadgetbridge.
|
||||||
|
|
||||||
@ -20,10 +20,14 @@ package nodomain.freeyourgadget.gadgetbridge.util;
|
|||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import io.wax911.emojify.EmojiManager;
|
import io.wax911.emojify.EmojiManager;
|
||||||
import io.wax911.emojify.EmojiUtils;
|
import io.wax911.emojify.EmojiUtils;
|
||||||
|
|
||||||
public class EmojiConverter {
|
public class EmojiConverter {
|
||||||
|
private static final Logger LOG = LoggerFactory.getLogger(EmojiConverter.class);
|
||||||
|
|
||||||
private static final String[][] simpleEmojiMapping = {
|
private static final String[][] simpleEmojiMapping = {
|
||||||
{"\uD83D\uDE00", ":-D"}, // grinning
|
{"\uD83D\uDE00", ":-D"}, // grinning
|
||||||
@ -81,8 +85,12 @@ public class EmojiConverter {
|
|||||||
|
|
||||||
private static String convertAdvancedEmojiToAscii(String text, Context context) {
|
private static String convertAdvancedEmojiToAscii(String text, Context context) {
|
||||||
initEmojiData(context);
|
initEmojiData(context);
|
||||||
|
try {
|
||||||
return EmojiUtils.shortCodify(text);
|
return EmojiUtils.shortCodify(text);
|
||||||
|
} catch (Exception e){
|
||||||
|
LOG.warn("An exception occured when converting advanced emoji to ASCII", text);
|
||||||
|
return text;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String convertUnicodeEmojiToAscii(String text, Context context) {
|
public static String convertUnicodeEmojiToAscii(String text, Context context) {
|
||||||
|
Loading…
Reference in New Issue
Block a user