EmoticonDecoder.java 文件源码

java
阅读 35 收藏 0 点赞 0 评论 0

项目:GifEmoji 作者:
private void load(Context context, @DrawableRes int drawableRes, int textSize, String url) {
    if (!nativeLoad(handle, url)) {
        nativeClose(handle);
        throw new RuntimeException("not gif");
    } else {
        frameNum = nativeGetFrameCount(handle);
        for (int i = 0; i < frameNum; i++) {
            BitmapDrawable drawable = new BitmapDrawable(context.getResources(), nativeGetFrame(handle, i));
            int width = (textSize * drawable.getIntrinsicWidth()) / drawable.getIntrinsicHeight();
            drawable.setBounds(0, 0, width, textSize);
            EmoticonCache.saveDrawable(drawableRes, i, drawable);
            delay = nativeGetDelay(handle, i);
        }
        nativeClose(handle);
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号