当前位置: 首页>>代码示例>>Java>>正文


Java FailType类代码示例

本文整理汇总了Java中com.nostra13.universalimageloader.core.assist.FailReason.FailType的典型用法代码示例。如果您正苦于以下问题:Java FailType类的具体用法?Java FailType怎么用?Java FailType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


FailType类属于com.nostra13.universalimageloader.core.assist.FailReason包,在下文中一共展示了FailType类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: fireFailEvent

import com.nostra13.universalimageloader.core.assist.FailReason.FailType; //导入依赖的package包/类
private void fireFailEvent(final FailType failType, final Throwable failCause) {
	if (syncLoading || isTaskInterrupted() || isTaskNotActual()) return;
	Runnable r = new Runnable() {
		@Override
		public void run() {
			if (options.shouldShowImageOnFail()) {
                   Bitmap bitmapOnFaile = options.getImageBitmapOnFail(configuration.resources);
                   if (options.getDisplayer() instanceof RoundedBitmapDisplayer && bitmapOnFaile != null) {
                       int corner = ((RoundedBitmapDisplayer) options.getDisplayer()).getRoundedBitmapCorner();
                       if (corner != 0) {
                           imageAware.setImageDrawable(new RoundedBitmapDisplayer.RoundedDrawable(bitmapOnFaile, corner, 0));
                       }
                   } else {
                       imageAware.setImageDrawable(options.getImageOnFail(configuration.resources));
                   }
               }
               listener.onLoadingFailed(uri, imageAware.getWrappedView(), new FailReason(failType, failCause));
		}
	};
	runTask(r, false, handler, engine);
}
 
开发者ID:hubcarl,项目名称:mobile-manager-tool,代码行数:22,代码来源:LoadAndDisplayImageTask.java

示例2: fireFailEvent

import com.nostra13.universalimageloader.core.assist.FailReason.FailType; //导入依赖的package包/类
/**
 * 图片加载失败事件处理分发
 * @param failType
 * @param failCause
 */
private void fireFailEvent(final FailType failType, final Throwable failCause) {
	if (syncLoading || isTaskInterrupted() || isTaskNotActual()) return;
	Runnable r = new Runnable() {
		@Override
		public void run() {
			if (options.shouldShowImageOnFail()) {
				//存在图片加载失败的占位图片配置,进行设置
				imageAware.setImageDrawable(options.getImageOnFail(configuration.resources));
			}
			//进行回调图片加载失败方法
			listener.onLoadingFailed(uri, imageAware.getWrappedView(), new FailReason(failType, failCause));
		}
	};
	//任务进行运行
	runTask(r, false, handler, engine);
}
 
开发者ID:jiangqqlmj,项目名称:Android-Universal-Image-Loader-Modify,代码行数:22,代码来源:LoadAndDisplayImageTask.java

示例3: fireFailEvent

import com.nostra13.universalimageloader.core.assist.FailReason.FailType; //导入依赖的package包/类
private void fireFailEvent(final FailType failType, final Throwable failCause) {
	if (syncLoading || isTaskInterrupted() || isTaskNotActual()) return;
	Runnable r = new Runnable() {
		@Override
		public void run() {
			if (options.shouldShowImageOnFail()) {
				imageAware.setImageDrawable(options.getImageOnFail(configuration.resources));
			}
			listener.onLoadingFailed(uri, imageAware.getWrappedView(), new FailReason(failType, failCause));
		}
	};
	runTask(r, false, handler, engine);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:14,代码来源:LoadAndDisplayImageTask.java

示例4: fireFailEvent

import com.nostra13.universalimageloader.core.assist.FailReason.FailType; //导入依赖的package包/类
private void fireFailEvent(final FailType failType, final Throwable failCause) {
    if (!this.syncLoading && !isTaskInterrupted() && !isTaskNotActual()) {
        runTask(new Runnable() {
            public void run() {
                if (LoadAndDisplayImageTask.this.options.shouldShowImageOnFail()) {
                    LoadAndDisplayImageTask.this.imageAware.setImageDrawable(LoadAndDisplayImageTask.this.options.getImageOnFail(LoadAndDisplayImageTask.this.configuration.resources));
                }
                LoadAndDisplayImageTask.this.listener.onLoadingFailed(LoadAndDisplayImageTask.this.uri, LoadAndDisplayImageTask.this.imageAware.getWrappedView(), new FailReason(failType, failCause));
            }
        }, false, this.handler, this.engine);
    }
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:13,代码来源:LoadAndDisplayImageTask.java

示例5: fireFailEvent

import com.nostra13.universalimageloader.core.assist.FailReason.FailType; //导入依赖的package包/类
private void fireFailEvent(final FailType failType, final Throwable failCause) {
    if (syncLoading || isTaskInterrupted() || isTaskNotActual()) return;
    Runnable r = new Runnable() {
        @Override
        public void run() {
            if (options.shouldShowImageOnFail()) {
                imageAware.setImageDrawable(options.getImageOnFail(configuration.resources));
            }
            listener.onLoadingFailed(uri, imageAware.getWrappedView(), new FailReason(failType, failCause));
        }
    };
    runTask(r, false, handler, engine);
}
 
开发者ID:Spencer231,项目名称:GifImageLoader,代码行数:14,代码来源:LoadAndDisplayImageTask.java

示例6: fireFailEvent

import com.nostra13.universalimageloader.core.assist.FailReason.FailType; //导入依赖的package包/类
private void fireFailEvent(final FailType failType, final Throwable failCause) {
	if (options.isSyncLoading() || isTaskInterrupted() || isTaskNotActual()) return;
	handler.post(new Runnable() {
		@Override
		public void run() {
			if (options.shouldShowImageOnFail()) {
				imageAware.setImageDrawable(options.getImageOnFail(configuration.resources));
			}
			listener.onLoadingFailed(uri, imageAware.getWrappedView(), new FailReason(failType, failCause));
		}
	});
}
 
开发者ID:Apokrif,项目名称:morse,代码行数:13,代码来源:LoadAndDisplayImageTask.java

示例7: fireImageLoadingFailedEvent

import com.nostra13.universalimageloader.core.assist.FailReason.FailType; //导入依赖的package包/类
private void fireImageLoadingFailedEvent(final FailType failType, final Throwable failCause) {
	if (!Thread.interrupted()) {
		handler.post(new Runnable() {
			@Override
			public void run() {
				if (options.shouldShowImageOnFail()) {
					imageView.setImageResource(options.getImageOnFail());
				}
				listener.onLoadingFailed(uri, imageView, new FailReason(failType, failCause));
			}
		});
	}
}
 
开发者ID:jixieshi999,项目名称:juahya,代码行数:14,代码来源:LoadAndDisplayImageTask.java

示例8: tryLoadBitmap

import com.nostra13.universalimageloader.core.assist.FailReason.FailType; //导入依赖的package包/类
private Bitmap tryLoadBitmap() throws TaskCancelledException {
    Bitmap bitmap = null;
    if (this.thumbnailUtils != null && this.uri.startsWith("LetvThumbnailUtils")) {
        bitmap = this.thumbnailUtils.getThumbnailBitmap(this.uri.replace("LetvThumbnailUtils", ""));
        if (bitmap != null) {
            return bitmap;
        }
    }
    try {
        File imageFile = this.configuration.diskCache.get(this.uri);
        if (imageFile != null && imageFile.exists()) {
            L.d(LOG_LOAD_IMAGE_FROM_DISK_CACHE, this.memoryCacheKey);
            this.loadedFrom = LoadedFrom.DISC_CACHE;
            checkTaskNotActual();
            bitmap = decodeImage(Scheme.FILE.wrap(imageFile.getAbsolutePath()));
        }
        if (bitmap == null || bitmap.getWidth() <= 0 || bitmap.getHeight() <= 0) {
            L.d(LOG_LOAD_IMAGE_FROM_NETWORK, this.memoryCacheKey);
            this.loadedFrom = LoadedFrom.NETWORK;
            String imageUriForDecoding = this.uri;
            if (this.options.isCacheOnDisk() && tryCacheImageOnDisk()) {
                imageFile = this.configuration.diskCache.get(this.uri);
                if (imageFile != null) {
                    imageUriForDecoding = Scheme.FILE.wrap(imageFile.getAbsolutePath());
                }
            }
            checkTaskNotActual();
            bitmap = decodeImage(imageUriForDecoding);
            if (bitmap == null || bitmap.getWidth() <= 0 || bitmap.getHeight() <= 0) {
                fireFailEvent(FailType.DECODING_ERROR, null);
            }
        }
    } catch (IllegalStateException e) {
        fireFailEvent(FailType.NETWORK_DENIED, null);
    } catch (TaskCancelledException e2) {
        throw e2;
    } catch (IOException e3) {
        L.e(e3);
        fireFailEvent(FailType.IO_ERROR, e3);
    } catch (OutOfMemoryError e4) {
        L.e(e4);
        fireFailEvent(FailType.OUT_OF_MEMORY, e4);
    } catch (Throwable e5) {
        L.e(e5);
        fireFailEvent(FailType.UNKNOWN, e5);
    }
    return bitmap;
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:49,代码来源:LoadAndDisplayImageTask.java

示例9: tryLoadBitmap

import com.nostra13.universalimageloader.core.assist.FailReason.FailType; //导入依赖的package包/类
private Bitmap tryLoadBitmap() throws TaskCancelledException {
    Bitmap bitmap = null;
    try {
        File imageFile = this.configuration.diskCache.get(this.uri);
        if (imageFile != null && imageFile.exists() && imageFile.length() > 0) {
            L.d(LOG_LOAD_IMAGE_FROM_DISK_CACHE, this.memoryCacheKey);
            this.loadedFrom = LoadedFrom.DISC_CACHE;
            checkTaskNotActual();
            bitmap = decodeImage(Scheme.FILE.wrap(imageFile.getAbsolutePath()));
        }
        if (bitmap == null || bitmap.getWidth() <= 0 || bitmap.getHeight() <= 0) {
            L.d(LOG_LOAD_IMAGE_FROM_NETWORK, this.memoryCacheKey);
            this.loadedFrom = LoadedFrom.NETWORK;
            String imageUriForDecoding = this.uri;
            if (this.options.isCacheOnDisk() && tryCacheImageOnDisk()) {
                imageFile = this.configuration.diskCache.get(this.uri);
                if (imageFile != null) {
                    imageUriForDecoding = Scheme.FILE.wrap(imageFile.getAbsolutePath());
                }
            }
            checkTaskNotActual();
            bitmap = decodeImage(imageUriForDecoding);
            if (bitmap == null || bitmap.getWidth() <= 0 || bitmap.getHeight() <= 0) {
                fireFailEvent(FailType.DECODING_ERROR, null);
            }
        }
    } catch (IllegalStateException e) {
        fireFailEvent(FailType.NETWORK_DENIED, null);
    } catch (TaskCancelledException e2) {
        throw e2;
    } catch (IOException e3) {
        L.e(e3);
        fireFailEvent(FailType.IO_ERROR, e3);
    } catch (OutOfMemoryError e4) {
        L.e(e4);
        fireFailEvent(FailType.OUT_OF_MEMORY, e4);
    } catch (Throwable e5) {
        L.e(e5);
        fireFailEvent(FailType.UNKNOWN, e5);
    }
    return bitmap;
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:43,代码来源:LoadAndDisplayImageTask.java

示例10: fireFailEvent

import com.nostra13.universalimageloader.core.assist.FailReason.FailType; //导入依赖的package包/类
private void fireFailEvent(FailType failType, Throwable failCause) {
    if (!this.syncLoading && !isTaskInterrupted() && !isTaskNotActual()) {
        runTask(new 2 (this, failType, failCause),false, this.handler, this.engine);
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:6,代码来源:LoadAndDisplayImageTask.java


注:本文中的com.nostra13.universalimageloader.core.assist.FailReason.FailType类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。