aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger/services/AbstractEmojiService.java
blob: ff10acf0cdc706aab487bbd71eb8bd9f23ca0f2c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package de.pixart.messenger.services;

import android.content.Context;
import android.support.text.emoji.EmojiCompat;
import android.util.Log;

import de.pixart.messenger.Config;
import de.pixart.messenger.utils.Emoticons;

public abstract class AbstractEmojiService {

    protected final Context context;

    public AbstractEmojiService(Context context) {
        this.context = context;
    }

    protected abstract EmojiCompat.Config buildConfig();

    public void init(boolean useBundledEmoji) {
        Log.d(Config.LOGTAG, "Emojis: use integrated lib " + useBundledEmoji);
        EmojiCompat.Config config = buildConfig();
        config.setReplaceAll(useBundledEmoji);
        EmojiCompat.reset(config);
        EmojiCompat.init(config);
    }
}