本文整理匯總了Java中com.nostra13.universalimageloader.core.listener.ImageLoadingListener.onLoadingComplete方法的典型用法代碼示例。如果您正苦於以下問題:Java ImageLoadingListener.onLoadingComplete方法的具體用法?Java ImageLoadingListener.onLoadingComplete怎麽用?Java ImageLoadingListener.onLoadingComplete使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.nostra13.universalimageloader.core.listener.ImageLoadingListener
的用法示例。
在下文中一共展示了ImageLoadingListener.onLoadingComplete方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: show
import com.nostra13.universalimageloader.core.listener.ImageLoadingListener; //導入方法依賴的package包/類
public static boolean show(String url, ImageView imageView, ImageLoadingListener listener){
imageView.setImageDrawable(null);
if(url == null)
return false;
if(!url.startsWith("http"))
url = ShikiApi.HTTP_SERVER + url;
if(url.contains(".gif") && Build.VERSION.SDK_INT > 13){
Ion.with(imageView)
.animateGif(AnimateGifMode.ANIMATE)
// .animateLoad(R.anim.spin_animation)
.smartSize(true)
.error(R.drawable.missing_preview)
.load(url);
if(listener!=null)
listener.onLoadingComplete(null,null,null);
}
else
ImageLoader.getInstance().displayImage(url, imageView, listener);
return true;
}
示例2: getWithListener
import com.nostra13.universalimageloader.core.listener.ImageLoadingListener; //導入方法依賴的package包/類
public void getWithListener(String imageUri,String access_token,ImageLoadingListener listener,int round,int defaultDrawable) {
Bitmap bitmap = null;
bitmap = _imageLoader.loadImageSync(imageUri,access_token);
if(bitmap != null){
if(listener != null){
listener.onLoadingComplete(imageUri, null, bitmap);
}
}else{
get(imageUri,access_token, listener,0);
}
}
示例3: getWithListener
import com.nostra13.universalimageloader.core.listener.ImageLoadingListener; //導入方法依賴的package包/類
public void getWithListener(String imageUri,ImageLoadingListener listener,int round,int defaultDrawable) {
Bitmap bitmap = null;
bitmap = _imageLoader.loadImageSync(imageUri);
if(bitmap != null){
if(listener != null){
listener.onLoadingComplete(imageUri, null, bitmap);
}
}else{
get(imageUri, listener,0);
}
}
示例4: displayImage
import com.nostra13.universalimageloader.core.listener.ImageLoadingListener; //導入方法依賴的package包/類
public void displayImage(String uri, ImageAware imageAware, DisplayImageOptions options, ImageLoadingListener listener, ImageLoadingProgressListener progressListener) {
checkConfiguration();
if (imageAware == null) {
throw new IllegalArgumentException(ERROR_WRONG_ARGUMENTS);
}
if (listener == null) {
listener = this.emptyListener;
}
if (options == null) {
options = this.configuration.defaultDisplayImageOptions;
}
if (TextUtils.isEmpty(uri)) {
this.engine.cancelDisplayTaskFor(imageAware);
listener.onLoadingStarted(uri, imageAware.getWrappedView());
if (options.shouldShowImageForEmptyUri()) {
imageAware.setImageDrawable(options.getImageForEmptyUri(this.configuration.resources));
} else {
imageAware.setImageDrawable(null);
}
listener.onLoadingComplete(uri, imageAware.getWrappedView(), null);
return;
}
ImageSize targetSize = ImageSizeUtils.defineTargetSizeForView(imageAware, this.configuration.getMaxImageSize());
String memoryCacheKey = MemoryCacheUtils.generateKey(uri, targetSize);
this.engine.prepareDisplayTaskFor(imageAware, memoryCacheKey);
listener.onLoadingStarted(uri, imageAware.getWrappedView());
Bitmap bmp = (Bitmap) this.configuration.memoryCache.get(memoryCacheKey);
if (bmp == null || bmp.isRecycled()) {
if (options.shouldShowImageOnLoading()) {
imageAware.setImageDrawable(options.getImageOnLoading(this.configuration.resources));
} else if (options.isResetViewBeforeLoading()) {
imageAware.setImageDrawable(null);
}
LoadAndDisplayImageTask displayTask = new LoadAndDisplayImageTask(this.engine, new ImageLoadingInfo(uri, imageAware, targetSize, memoryCacheKey, options, listener, progressListener, this.engine.getLockForUri(uri)), defineHandler(options));
if (options.isSyncLoading()) {
displayTask.run();
return;
} else {
this.engine.submit(displayTask);
return;
}
}
L.d(LOG_LOAD_IMAGE_FROM_MEMORY_CACHE, memoryCacheKey);
if (options.shouldPostProcess()) {
ProcessAndDisplayImageTask displayTask2 = new ProcessAndDisplayImageTask(this.engine, bmp, new ImageLoadingInfo(uri, imageAware, targetSize, memoryCacheKey, options, listener, progressListener, this.engine.getLockForUri(uri)), defineHandler(options));
if (options.isSyncLoading()) {
displayTask2.run();
return;
} else {
this.engine.submit(displayTask2);
return;
}
}
options.getDisplayer().display(bmp, imageAware, LoadedFrom.MEMORY_CACHE);
listener.onLoadingComplete(uri, imageAware.getWrappedView(), bmp);
}
示例5: displayImage
import com.nostra13.universalimageloader.core.listener.ImageLoadingListener; //導入方法依賴的package包/類
public void displayImage(String uri, ImageAware imageAware, DisplayImageOptions options,
ImageSize targetSize, ImageLoadingListener listener,
ImageLoadingProgressListener progressListener) {
checkConfiguration();
if (imageAware == null) {
throw new IllegalArgumentException(ERROR_WRONG_ARGUMENTS);
}
if (listener == null) {
listener = this.defaultListener;
}
if (options == null) {
options = this.configuration.defaultDisplayImageOptions;
}
if (TextUtils.isEmpty(uri)) {
this.engine.cancelDisplayTaskFor(imageAware);
listener.onLoadingStarted(uri, imageAware.getWrappedView());
if (options.shouldShowImageForEmptyUri()) {
imageAware.setImageDrawable(options.getImageForEmptyUri(this.configuration
.resources));
} else {
imageAware.setImageDrawable(null);
}
listener.onLoadingComplete(uri, imageAware.getWrappedView(), null);
return;
}
if (targetSize == null) {
targetSize = ImageSizeUtils.defineTargetSizeForView(imageAware, this.configuration
.getMaxImageSize());
}
String memoryCacheKey = MemoryCacheUtils.generateKey(uri, targetSize);
this.engine.prepareDisplayTaskFor(imageAware, memoryCacheKey);
listener.onLoadingStarted(uri, imageAware.getWrappedView());
Bitmap bmp = this.configuration.memoryCache.get(memoryCacheKey);
if (bmp == null || bmp.isRecycled()) {
if (options.shouldShowImageOnLoading()) {
imageAware.setImageDrawable(options.getImageOnLoading(this.configuration
.resources));
} else if (options.isResetViewBeforeLoading()) {
imageAware.setImageDrawable(null);
}
LoadAndDisplayImageTask displayTask = new LoadAndDisplayImageTask(this.engine, new
ImageLoadingInfo(uri, imageAware, targetSize, memoryCacheKey, options,
listener, progressListener, this.engine.getLockForUri(uri)), defineHandler
(options));
if (options.isSyncLoading()) {
displayTask.run();
return;
} else {
this.engine.submit(displayTask);
return;
}
}
L.d(LOG_LOAD_IMAGE_FROM_MEMORY_CACHE, memoryCacheKey);
if (options.shouldPostProcess()) {
ProcessAndDisplayImageTask displayTask2 = new ProcessAndDisplayImageTask(this.engine,
bmp, new ImageLoadingInfo(uri, imageAware, targetSize, memoryCacheKey,
options, listener, progressListener, this.engine.getLockForUri(uri)),
defineHandler(options));
if (options.isSyncLoading()) {
displayTask2.run();
return;
} else {
this.engine.submit(displayTask2);
return;
}
}
options.getDisplayer().display(bmp, imageAware, LoadedFrom.MEMORY_CACHE);
listener.onLoadingComplete(uri, imageAware.getWrappedView(), bmp);
}