Skip to content

Commit

Permalink
修复一处callback可能为null的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
wyouflf committed Oct 21, 2014
1 parent 3f97387 commit 36280b2
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions library/src/com/lidroid/xutils/BitmapUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -218,13 +218,6 @@ public <T extends View> void display(T container, String uri, BitmapDisplayConfi
return;
}

if (TextUtils.isEmpty(uri)) {
callBack.onLoadFailed(container, uri, displayConfig.getLoadFailedDrawable());
return;
}

container.clearAnimation();

if (callBack == null) {
callBack = new DefaultBitmapLoadCallBack<T>();
}
Expand All @@ -237,6 +230,14 @@ public <T extends View> void display(T container, String uri, BitmapDisplayConfi
BitmapSize size = displayConfig.getBitmapMaxSize();
displayConfig.setBitmapMaxSize(BitmapCommonUtils.optimizeMaxSizeByView(container, size.getWidth(), size.getHeight()));

container.clearAnimation();

if (TextUtils.isEmpty(uri)) {
callBack.onLoadFailed(container, uri, displayConfig.getLoadFailedDrawable());
return;
}

// start loading
callBack.onPreLoad(container, uri, displayConfig);

// find bitmap from mem cache.
Expand Down

0 comments on commit 36280b2

Please sign in to comment.