aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2017-12-16 22:17:01 +0100
committerChristian Schneppe <christian@pix-art.de>2017-12-16 22:17:01 +0100
commit5326111db15e24047807f2d95698c5fa800dd733 (patch)
tree369fe6c6c63c974439779e719c89adb2866d534b
parente87c2b325bc372536f0c29bc72660143272d8086 (diff)
initialize emoji helper in StartConversationActivity
-rw-r--r--src/main/java/de/pixart/messenger/ui/StartConversationActivity.java2
-rw-r--r--src/main/java/de/pixart/messenger/utils/EmojiWrapper.java11
2 files changed, 9 insertions, 4 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java b/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java
index 23a0bf011..5e7d8f0f1 100644
--- a/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/StartConversationActivity.java
@@ -72,6 +72,7 @@ import de.pixart.messenger.entities.Contact;
import de.pixart.messenger.entities.Conversation;
import de.pixart.messenger.entities.ListItem;
import de.pixart.messenger.entities.Presence;
+import de.pixart.messenger.services.EmojiService;
import de.pixart.messenger.services.XmppConnectionService.OnRosterUpdate;
import de.pixart.messenger.ui.adapter.KnownHostsAdapter;
import de.pixart.messenger.ui.adapter.ListItemAdapter;
@@ -272,6 +273,7 @@ public class StartConversationActivity extends XmppActivity implements OnRosterU
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
+ new EmojiService(this).init();
setContentView(R.layout.activity_start_conversation);
mViewPager = findViewById(R.id.start_conversation_view_pager);
ActionBar actionBar = getActionBar();
diff --git a/src/main/java/de/pixart/messenger/utils/EmojiWrapper.java b/src/main/java/de/pixart/messenger/utils/EmojiWrapper.java
index db2bf1242..d30c68a97 100644
--- a/src/main/java/de/pixart/messenger/utils/EmojiWrapper.java
+++ b/src/main/java/de/pixart/messenger/utils/EmojiWrapper.java
@@ -33,10 +33,13 @@ import android.support.text.emoji.EmojiCompat;
public class EmojiWrapper {
public static CharSequence transform(CharSequence input) {
- final CharSequence charSequence;
- if (EmojiCompat.get().getLoadState() == EmojiCompat.LOAD_STATE_SUCCEEDED) {
- return EmojiCompat.get().process(input);
- } else {
+ try {
+ if (EmojiCompat.get().getLoadState() == EmojiCompat.LOAD_STATE_SUCCEEDED) {
+ return EmojiCompat.get().process(input);
+ } else {
+ return input;
+ }
+ } catch (IllegalStateException e) {
return input;
}
}