Android Open Source - EmojiEverywhere Emojicon Span






From Project

Back to project page EmojiEverywhere.

License

The source code is released under:

GNU General Public License

If you think the Android project EmojiEverywhere listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package emojicon;
//from ww w. j  av  a 2 s. c  o  m
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.text.style.DynamicDrawableSpan;

/**
 * @author Chathura Wijesinghe (cdanasiri@gmail.com)
 */
class EmojiconSpan extends DynamicDrawableSpan {
    private final Context mContext;
    private final int mResourceId;
    private final int mSize;
    private Drawable mDrawable;

    public EmojiconSpan(Context context, int resourceId, int size) {
        super();
        mContext = context;
        mResourceId = resourceId;
        mSize = size;
    }

    public Drawable getDrawable() {
        if (mDrawable == null) {
            try {
                mDrawable = mContext.getResources().getDrawable(mResourceId);
                int size = mSize;
                mDrawable.setBounds(0, 0, size, size);
            } catch (Exception e) {
                // swallow
            }
        }
        return mDrawable;
    }
}




Java Source Code List

emoji.sithagi.com.emojieverywhere.EmijiView.java
emoji.sithagi.com.emojieverywhere.EmojiHorizontalScrollView.java
emojicon.EmojiAdapter.java
emojicon.EmojiconEditText.java
emojicon.EmojiconGridFragment.java
emojicon.EmojiconHandler.java
emojicon.EmojiconSpan.java
emojicon.EmojiconTextView.java
emojicon.EmojiconsFragment.java
emojicon.emoji.Emojicon.java
emojicon.emoji.Nature.java
emojicon.emoji.Objects.java
emojicon.emoji.People.java
emojicon.emoji.Places.java
emojicon.emoji.Symbols.java