public void setImageBitmap(@Nullable final Drawable fromDrawable, @Nullable final Bitmap toBitmap) {
final int width = getMeasuredWidth();
final int height = getMeasuredHeight();
Runnable runnable = new Runnable() {
@Override
public void run() {
final TransitionDrawable td = new TransitionDrawable(new Drawable[]{
fromDrawable, new BitmapDrawable(getResources(),
getScaleType() == ScaleType.CENTER_CROP ?
centerCrop(getResources(), toBitmap, width, height) :
toBitmap)});
RImageView.super.setImageDrawable(td);
td.startTransition(300);
}
};
if (width == 0 || height == 0) {
post(runnable);
} else {
runnable.run();
}
}
RImageView.java 文件源码
java
阅读 20
收藏 0
点赞 0
评论 0
项目:RLibrary
作者:
评论列表
文章目录