diff options
author | iNPUTmice <daniel@gultsch.de> | 2014-09-08 23:58:37 +0200 |
---|---|---|
committer | iNPUTmice <daniel@gultsch.de> | 2014-09-08 23:58:37 +0200 |
commit | d92e8381db906c20ceb7f91914d63d514a873c8a (patch) | |
tree | 94367a08152e5704eeb4b6b51747919669b46a55 /src/eu/siacs/conversations/utils/UIHelper.java | |
parent | d9c4637b31c79095d7acff43fee03daa83859ea3 (diff) |
setting to increase font size. fixed #420
Diffstat (limited to 'src/eu/siacs/conversations/utils/UIHelper.java')
-rw-r--r-- | src/eu/siacs/conversations/utils/UIHelper.java | 42 |
1 files changed, 22 insertions, 20 deletions
diff --git a/src/eu/siacs/conversations/utils/UIHelper.java b/src/eu/siacs/conversations/utils/UIHelper.java index 896bdb7d..54c370ef 100644 --- a/src/eu/siacs/conversations/utils/UIHelper.java +++ b/src/eu/siacs/conversations/utils/UIHelper.java @@ -215,8 +215,8 @@ public class UIHelper { List<User> members = conversation.getMucOptions().getUsers(); if (members.size() == 0) { return getUnknownContactPicture( - new String[] { conversation.getName() }, size, - bgColor, fgColor); + new String[] { conversation.getName() }, size, bgColor, + fgColor); } ArrayList<String> names = new ArrayList<String>(); names.add(conversation.getMucOptions().getActualNick()); @@ -548,35 +548,37 @@ public class UIHelper { private final static class EmoticonPattern { Pattern pattern; String replacement; + EmoticonPattern(String ascii, int unicode) { - this.pattern = Pattern.compile("(?<=(^|\\s))" + ascii + "(?=(\\s|$))"); - this.replacement = new String(new int[]{unicode, }, 0, 1); + this.pattern = Pattern.compile("(?<=(^|\\s))" + ascii + + "(?=(\\s|$))"); + this.replacement = new String(new int[] { unicode, }, 0, 1); } + String replaceAll(String body) { return pattern.matcher(body).replaceAll(replacement); } } private static final EmoticonPattern[] patterns = new EmoticonPattern[] { - new EmoticonPattern(":-?D", 0x1f600), - new EmoticonPattern("\\^\\^", 0x1f601), - new EmoticonPattern(":'D", 0x1f602), - new EmoticonPattern("\\]-?D", 0x1f608), - new EmoticonPattern(";-?\\)", 0x1f609), - new EmoticonPattern(":-?\\)", 0x1f60a), - new EmoticonPattern("[B8]-?\\)", 0x1f60e), - new EmoticonPattern(":-?\\|", 0x1f610), - new EmoticonPattern(":-?[/\\\\]", 0x1f615), - new EmoticonPattern(":-?\\*", 0x1f617), - new EmoticonPattern(":-?[Ppb]", 0x1f61b), - new EmoticonPattern(":-?\\(", 0x1f61e), - new EmoticonPattern(":-?[0Oo]", 0x1f62e), - new EmoticonPattern("\\\\o/", 0x1F631), - }; + new EmoticonPattern(":-?D", 0x1f600), + new EmoticonPattern("\\^\\^", 0x1f601), + new EmoticonPattern(":'D", 0x1f602), + new EmoticonPattern("\\]-?D", 0x1f608), + new EmoticonPattern(";-?\\)", 0x1f609), + new EmoticonPattern(":-?\\)", 0x1f60a), + new EmoticonPattern("[B8]-?\\)", 0x1f60e), + new EmoticonPattern(":-?\\|", 0x1f610), + new EmoticonPattern(":-?[/\\\\]", 0x1f615), + new EmoticonPattern(":-?\\*", 0x1f617), + new EmoticonPattern(":-?[Ppb]", 0x1f61b), + new EmoticonPattern(":-?\\(", 0x1f61e), + new EmoticonPattern(":-?[0Oo]", 0x1f62e), + new EmoticonPattern("\\\\o/", 0x1F631), }; public static String transformAsciiEmoticons(String body) { if (body != null) { - for (EmoticonPattern p: patterns) { + for (EmoticonPattern p : patterns) { body = p.replaceAll(body); } body = body.trim(); |