GameItemView.java 文件源码

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

项目:recycler-view-optimization 作者:
@Override
public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom from) {
    final Drawable resultDrawable;

    if (from == Picasso.LoadedFrom.MEMORY) {
        resultDrawable = new BitmapDrawable(getResources(), bitmap);
    } else {
        TransitionDrawable transitionDrawable = new TransitionDrawable(
                new Drawable[]{iconDrawable, new BitmapDrawable(getResources(), bitmap)});
        transitionDrawable.startTransition(300);

        resultDrawable = transitionDrawable;
    }

    resultDrawable.setCallback(this);
    resultDrawable.setBounds(iconDrawable.getBounds());

    iconDrawable = resultDrawable;
    invalidate();
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号