Back to project page EmojiEverywhere.
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.
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; } }