Skip to content

Commit

Permalink
KJBitmap.display()中如果url为空时,添加callback.onFailure()回调
Browse files Browse the repository at this point in the history
  • Loading branch information
kymjs committed Sep 22, 2015
1 parent bfc6999 commit e6669c7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion KJFrame/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
#org.gradle.parallel=true
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public KJBitmap(BitmapConfig bitmapConfig) {
public KJBitmap(HttpConfig httpConfig, BitmapConfig bitmapConfig) {
this.mConfig = bitmapConfig;
displayer = new ImageDisplayer(httpConfig, mConfig);
doLoadingViews = new Vector<View>(30);
doLoadingViews = new Vector<>(30);
}

/**
Expand Down Expand Up @@ -233,6 +233,9 @@ public void display(View imageView, String imageUrl, int width, int height,
if (StringUtils.isEmpty(imageUrl)) {
showLogIfOpen("image url is empty");
setViewImage(imageView, errorBitmap);
if (callback != null) {
callback.onFailure(new RuntimeException("image url is empty"));
}
return;
}

Expand Down

0 comments on commit e6669c7

Please sign in to comment.