aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger/services
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2017-11-24 21:41:15 +0100
committerChristian Schneppe <christian@pix-art.de>2017-11-24 21:41:15 +0100
commitb741b8bf12118bd13d43c62ea5c1598bd078348e (patch)
tree0ef0abe20af33c121e4c6540b438964aa35f6685 /src/main/java/de/pixart/messenger/services
parentfca8eacabec77f4c3604a71763915c32e09d286d (diff)
use com.android.support:support-emoji
Diffstat (limited to 'src/main/java/de/pixart/messenger/services')
-rw-r--r--src/main/java/de/pixart/messenger/services/AbstractEmojiService.java21
-rw-r--r--src/main/java/de/pixart/messenger/services/EmojiService.java17
-rw-r--r--src/main/java/de/pixart/messenger/services/NotificationService.java2
3 files changed, 39 insertions, 1 deletions
diff --git a/src/main/java/de/pixart/messenger/services/AbstractEmojiService.java b/src/main/java/de/pixart/messenger/services/AbstractEmojiService.java
new file mode 100644
index 000000000..75f1a4c98
--- /dev/null
+++ b/src/main/java/de/pixart/messenger/services/AbstractEmojiService.java
@@ -0,0 +1,21 @@
+package de.pixart.messenger.services;
+
+import android.content.Context;
+import android.support.text.emoji.EmojiCompat;
+
+public abstract class AbstractEmojiService {
+
+ protected final Context context;
+
+ public AbstractEmojiService(Context context) {
+ this.context = context;
+ }
+
+ protected abstract EmojiCompat.Config buildConfig();
+
+ public void init() {
+ final EmojiCompat.Config config = buildConfig();
+ config.setReplaceAll(true);
+ EmojiCompat.init(config);
+ }
+} \ No newline at end of file
diff --git a/src/main/java/de/pixart/messenger/services/EmojiService.java b/src/main/java/de/pixart/messenger/services/EmojiService.java
new file mode 100644
index 000000000..6f8d8facd
--- /dev/null
+++ b/src/main/java/de/pixart/messenger/services/EmojiService.java
@@ -0,0 +1,17 @@
+package de.pixart.messenger.services;
+
+import android.content.Context;
+import android.support.text.emoji.EmojiCompat;
+import android.support.text.emoji.bundled.BundledEmojiCompatConfig;
+
+public class EmojiService extends AbstractEmojiService {
+
+ public EmojiService(Context context) {
+ super(context);
+ }
+
+ @Override
+ protected EmojiCompat.Config buildConfig() {
+ return new BundledEmojiCompatConfig(context);
+ }
+} \ No newline at end of file
diff --git a/src/main/java/de/pixart/messenger/services/NotificationService.java b/src/main/java/de/pixart/messenger/services/NotificationService.java
index f7416bca6..9f78fa751 100644
--- a/src/main/java/de/pixart/messenger/services/NotificationService.java
+++ b/src/main/java/de/pixart/messenger/services/NotificationService.java
@@ -510,7 +510,7 @@ public class NotificationService {
for (Message message : messages) {
Pair<String, Boolean> preview = UIHelper.getMessagePreview(mXmppConnectionService, message);
// only show user written text
- if (preview.second == false) {
+ if (!preview.second) {
uBuilder.addMessage(preview.first);
uBuilder.setLatestTimestamp(message.getTimeSent());
}