use of cn.jeesoft.qa.libcore.image.DefaultImage in project QuickAndroid by ImKarl.
the class QACore method getImage.
/**
* 获取全局网络请求管理类
*/
public static final QAImage getImage() throws QANullException {
if (StaticImage == null) {
synchronized (QAImage.class) {
if (StaticImage == null) {
QAImage image = null;
try {
Drawable imageLoading = getConfig().getDrawable(QAConfig.Http.IMAGE_LOADING);
Drawable imageLoadfail = getConfig().getDrawable(QAConfig.Http.IMAGE_LOADFAIL);
if (imageLoading == null || imageLoadfail == null) {
image = new DefaultImage(new QAPrivateCheck() {
@Override
public boolean check() {
return true;
}
}, getApp().getApplication(), imageLoading, imageLoadfail);
}
} catch (Exception e) {
}
if (image == null) {
int imageLoadingRes = getConfig().getInt(QAConfig.Http.IMAGE_LOADING);
int imageLoadfailRes = getConfig().getInt(QAConfig.Http.IMAGE_LOADFAIL);
image = new DefaultImage(new QAPrivateCheck() {
@Override
public boolean check() {
return true;
}
}, getApp().getApplication(), imageLoadingRes, imageLoadfailRes);
}
StaticImage = image;
}
}
}
if (StaticImage == null) {
throw new QANullException("QAImage create Failed.");
}
return StaticImage;
}
Aggregations