Java 类com.nostra13.universalimageloader.core.assist.FailReason 实例源码

项目:android_image_loader    文件:ImageTask.java   
/**
 * Creates a new instance of Error from the given <var>failReason</var>.
 *
 * @param failReason The reason from which to create the error.
 * @return New error instance.
 */
private static ImageLoader.Error errorFromFailReason(FailReason failReason) {
    int reason = ImageLoader.Error.REASON_UNKNOWN;
    switch (failReason.getType()) {
        case IO_ERROR:
            reason = ImageLoader.Error.REASON_IO;
            break;
        case DECODING_ERROR:
            reason = ImageLoader.Error.REASON_DECODING;
            break;
        case NETWORK_DENIED:
            reason = ImageLoader.Error.REASON_NETWORK;
            break;
        case OUT_OF_MEMORY:
            reason = ImageLoader.Error.REASON_MEMORY;
            break;
        case UNKNOWN:
        default:
    }
    return new ImageLoader.Error(reason, "Failed to load image.", failReason.getCause());
}
项目:AyoSunny    文件:ImageLoaderUseUIL.java   
@Override
public void onLoadingFailed(String imageUri, View view, FailReason failReason) {
    if(callback != null){
        //boolean isSuccess, String uri, String savedPath, String failInfo
        String errorInfo = "";
        if(failReason != null){
            if(failReason.getCause() != null){
                errorInfo = failReason.getCause().getLocalizedMessage();
                failReason.getCause().printStackTrace();
            }
        }
        callback.onFinish(false, imageUri, null, failReason.getCause().getLocalizedMessage());
    }else{
        if(failReason != null){
            if(failReason.getCause() != null){
                failReason.getCause().printStackTrace();
            }
        }
    }
}
项目:love    文件:PhotoActivity.java   
@Override
public void onLoadingFailed(String imageUri, View view,
        FailReason failReason) {
    String message = null;
    switch (failReason.getType()) {
    case IO_ERROR:
        message = "Input/Output error";
        break;
    case DECODING_ERROR:
        message = "Image can't be decoded";
        break;
    case NETWORK_DENIED:
        message = "Downloads are denied";
        break;
    case OUT_OF_MEMORY:
        message = "Out Of Memory error";
        break;
    case UNKNOWN:
        message = "Unknown error";
        break;
    }
    Log.w(TAG, "imageUri = " + imageUri + " message = " + message);
    ProgressBar spinner = (ProgressBar) view.getTag();
    spinner.setVisibility(View.GONE);
    view.setVisibility(View.VISIBLE);
}
项目:Android-Universal-Image-Loader-Modify    文件:LoadAndDisplayImageTask.java   
/**
 * 图片加载失败事件处理分发
 * @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);
}
项目:liquid-bear-android    文件:QueryManager.java   
public void getAlbumImage(final Album album, final CompletionListener listener) {
    if (album == null) return;
    imageLoader.loadImage(LiqearApplication.getAppContext(),
            album.getImageUrl(), new ImageLoadingListener() {
        @Override
        public void onLoadingStarted() {

        }

        @Override
        public void onLoadingFailed(FailReason failReason) {

        }

        @Override
        public void onLoadingComplete(Bitmap bitmap) {
            AudioTimeline.setCurrentAlbumBitmap(bitmap);
            listener.onCompleted();
        }

        @Override
        public void onLoadingCancelled() {

        }
    });
}
项目:festivity    文件:WallpaperItemPagerAdapter.java   
@Override
public void onLoadingFailed(String imageUri, View view, FailReason failReason) {
    String message = null;
    switch (failReason.getType()) {
        case IO_ERROR:
            message = "Input/Output error";
            break;
        case DECODING_ERROR:
            message = "Image can't be decoded";
            break;
        case NETWORK_DENIED:
            message = "Downloads are denied";
            break;
        case OUT_OF_MEMORY:
            message = "Out Of Memory error";
            break;
        case UNKNOWN:
            message = "Unknown error";
            break;
    }
    Toast.makeText(context, message, Toast.LENGTH_SHORT).show();
    spinner.setVisibility(View.GONE);
}
项目:GitHub    文件:LoadAndDisplayImageTask.java   
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);
}
项目:letv    文件:LoadAndDisplayImageTask.java   
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);
    }
}
项目:GifImageLoader    文件:LoadAndDisplayImageTask.java   
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);
}
项目:boohee_v5.6    文件:LoadAndDisplayImageTask$2.java   
public void run() {
    if (this.this$0.options.shouldShowImageOnFail()) {
        this.this$0.imageAware.setImageDrawable(this.this$0.options.getImageOnFail
                (LoadAndDisplayImageTask.access$000(this.this$0).resources));
    }
    this.this$0.listener.onLoadingFailed(this.this$0.uri, this.this$0.imageAware
            .getWrappedView(), new FailReason(this.val$failType, this.val$failCause));
}
项目:ImageLoaderSupportGif    文件:LoadAndDisplayImageTask.java   
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);
}
项目:yun2win-sdk-android    文件:LoadAndDisplayImageTask.java   
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);
}
项目:android-open-project-demo-master    文件:LoadAndDisplayImageTask.java   
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);
}
项目:BigApp_WordPress_Android    文件:LoadAndDisplayImageTask.java   
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);
}
项目:BigApp_WordPress_Android    文件:MediaDetailFragment.java   
@Override
public void onLoadingFailed(String imageUri, View view,
        FailReason failReason) {
    mImageView.setScaleType(ImageView.ScaleType.CENTER);
    mProgress.setVisibility(View.GONE);
    PhotoViewAttacher photo = new PhotoViewAttacher(mImageView);
    photo.setMaxScale(8);
    photo.setOnPhotoTapListener(this);
    photo.setOnViewTapListener(this);
}
项目:BigApp_WordPress_Android    文件:MediaPreviewCameraActivity.java   
@Override
public void onLoadingFailed(String imageUri, View view,
                            FailReason failReason) {
    mImageView.setScaleType(ImageView.ScaleType.CENTER);
    mProgress.setVisibility(View.GONE);
    PhotoViewAttacher photo = new PhotoViewAttacher(mImageView);
    photo.setMaxScale(8);
}
项目:AyoSunny    文件:LoadAndDisplayImageTask.java   
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);
}
项目:WliveTV    文件:LoadAndDisplayImageTask.java   
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);
}
项目:EveryXDay    文件:LoadAndDisplayImageTask.java   
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);
}
项目:QuickMeme-Generator    文件:Editor.java   
@Override
public void onLoadingFailed(String imageUri, View view,
        FailReason failReason) {
    super.onLoadingFailed(imageUri, view, failReason);
    MemeLayout.setVisibility(View.VISIBLE);
    progressBar.setVisibility(View.GONE);
    inferior.setVisibility(View.GONE);
    superior.setVisibility(View.GONE);
}
项目:https-github.com-nostra13-Android-Universal-Image-Loader    文件:LoadAndDisplayImageTask.java   
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);
}
项目:AlbumGridView    文件:UrlTouchImageView.java   
@Override
public void onLoadingFailed(String imageUri, View view,
        FailReason failReason)
{
    mProgressBar.setVisibility(View.GONE);
    mImageView.setVisibility(View.VISIBLE);
    mImageView.setImageDrawable(mLargeImageOptions
            .getImageOnFail(mContext.getResources()));
}
项目:CouldBooks    文件:LoadAndDisplayImageTask.java   
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);
}
项目:andoridDome    文件:LoadAndDisplayImageTask.java   
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);
}
项目:MiBandDecompiled    文件:n.java   
n(l l1, com.nostra13.universalimageloader.core.assist.FailReason.FailType failtype, Throwable throwable)
{
    c = l1;
    a = failtype;
    b = throwable;
    super();
}
项目:MiBandDecompiled    文件:n.java   
public void run()
{
    if (c.c.shouldShowImageOnFail())
    {
        c.b.setImageDrawable(c.c.getImageOnFail(l.a(c).a));
    }
    c.d.onLoadingFailed(c.a, c.b.getWrappedView(), new FailReason(a, b));
}
项目:apng-view    文件:ApngImageLoadingListener.java   
@Override
public void onLoadingFailed(String imageUri, View view, FailReason failReason) {
    if (view == null) return;

    Object tag = view.getTag(R.id.tag_image);
    if (enableDebugLog) FLog.d("tag: %s", tag);

    view.setTag(R.id.tag_image, null);

    if (shouldForward()) callback.onLoadFinish(false, imageUri, view);
}
项目:Nepenthes-Android    文件:LoadAndDisplayImageTask.java   
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);
}
项目:morse    文件:LoadAndDisplayImageTask.java   
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));
        }
    });
}
项目:juahya    文件:LoadAndDisplayImageTask.java   
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));
            }
        });
    }
}
项目:Masaccio    文件:DemoActivity.java   
@Override
public void onLoadingFailed(final String imageUri, final View view,
                            final FailReason failReason) {

    final DemoActivity demoActivity = mActivityReference.get();

    if (demoActivity != null) {

        Toast.makeText(demoActivity, "Error during image loading", Toast.LENGTH_SHORT)
                .show();
        demoActivity.mProgressBar.setVisibility(View.GONE);
    }
}
项目:OnTheRoad    文件:LoadAndDisplayImageTask.java   
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);
}
项目:Cthulhator    文件:RemoteImage.java   
@Override
public void onLoadingFailed(String imageUri, View view, FailReason failReason) {
    if (failbackAddress != null) {
        rLoadUrl(failbackAddress);
    } else {
        loadDefault();
    }
}
项目:danmaku-project    文件:LoadAndDisplayImageTask.java   
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);
}
项目:FaceTag-Android    文件:ImageLoaderUtility.java   
@Override
public void onLoadingFailed(String imageUri, View view,
        FailReason failReason) {
    String message = null;
    switch (failReason.getType()) {
    case IO_ERROR:
        message = "Input/Output error";
        break;
    case DECODING_ERROR:
        message = "Image can't be decoded";
        break;
    case NETWORK_DENIED:
        message = "Downloads are denied";
        break;
    case OUT_OF_MEMORY:
        message = "Out Of Memory error";
        break;
    case UNKNOWN:
        message = "Unknown error";
        break;
    }
    Animation a = ((ImageView) view).getAnimation();
    if (a != null)
        view.clearAnimation();
        //a.cancel();
    view.setVisibility(View.GONE);
}
项目:android-open-project-demo    文件:LoadAndDisplayImageTask.java   
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);
}
项目:GitHub    文件:SimpleImageLoadingListener.java   
@Override
public void onLoadingFailed(String imageUri, View view, FailReason failReason) {
    // Empty implementation
}
项目:mobile-store    文件:AppCardController.java   
@Override
public void onLoadingFailed(String imageUri, View view, FailReason failReason) {
    // Do nothing
}
项目:mobile-store    文件:FeatureImage.java   
@Override
public void onLoadingFailed(String imageUri, View view, FailReason failReason) { }
项目:rx-twitter-stream-android    文件:AvatarListener.java   
@Override
public void onLoadingFailed(String imageUri, View view, FailReason failReason) {
    // Can we use default image here? dont want to end stream if the image cannot be obtained
    // Or use onErrorResumeNext?
    //observer.onError(failReason.getCause());
}