GifEmoji

Additional

Language
Java
Version
1.0 (Dec 18, 2017)
Created
Dec 17, 2017
Updated
Jan 17, 2018
Owner
Hoàng Anh Tuấn (hoanganhtuan95ptit)
Contributor
Hoàng Anh Tuấn (hoanganhtuan95ptit)
1
Activity
Badge
Generate
Download
Source code

Promotion

GifEmoji

Library gif emoji like skype, messenger, wechat, whatapp, snapchat, facebook, zalo

Demo

Download

  • Step 1. Add it in your root build.gradle at the end of repositories:
    allprojects {
        repositories {
          ...
          maven { url 'https://jitpack.io' }
        }
    }
  • Step 2. Add the dependency
    dependencies {
   compile 'com.github.hoanganhtuan95ptit:GifEmoji:1.0'
    }

Using

  • xml
    <com.hoanganhtuan95ptit.gifemoji.EmoticonTextView
        android:id="@+id/tv_infor"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:emoticonSize="30sp"
        app:emoticonSchedule="40"/>
attr description
emoticonSize the size of the emoticon, default textSize
emoticonSchedule Emoticon refresh cycle, default 40

How to customize the EmoticonTextView

  • Customize EmoticonProvider
    public interface EmoticonProvider {

        HashMap<String, Integer> getEmoticons();

    }
  • Example
    public class GifEmoticonProvider implements EmoticonProvider {

        static final HashMap<String, Integer> EMOTICONS = new HashMap<>();

        static {
            EMOTICONS.put("(giggle)", R.drawable.giggle);
            EMOTICONS.put("(monkey)", R.drawable.monkey);
            EMOTICONS.put(":)", R.drawable.emoji_1);
            ...
        }

        private static GifEmoticonProvider exampleEmoticonProvider;

        public static GifEmoticonProvider create() {
            if (exampleEmoticonProvider == null) {
                exampleEmoticonProvider = new GifEmoticonProvider();
            }
            return exampleEmoticonProvider;
        }

        private GifEmoticonProvider() {
        }

        @Override
        public HashMap<String, Integer> getEmoticons() {
            return EMOTICONS;
        }

    }
  • set EmoticonProvider
    emoticonTextView.setEmoticonProvider(GifEmoticonProvider.create());
  • set Text
    emoticonTextView.setTextEmoticon(message.getInfo());

Thank

Name Library
waynejo android-ndk-gif