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


Java DrawableTypeRequest.error方法代码示例

本文整理汇总了Java中com.bumptech.glide.DrawableTypeRequest.error方法的典型用法代码示例。如果您正苦于以下问题:Java DrawableTypeRequest.error方法的具体用法?Java DrawableTypeRequest.error怎么用?Java DrawableTypeRequest.error使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.bumptech.glide.DrawableTypeRequest的用法示例。


在下文中一共展示了DrawableTypeRequest.error方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: loadNet

import com.bumptech.glide.DrawableTypeRequest; //导入方法依赖的package包/类
@Override
public void loadNet(Context context, String url, Options options, final LoadCallback callback) {
    DrawableTypeRequest request = getRequestManager(context).load(url);
    if (options == null) options = Options.defaultOptions();

    if (options.loadingResId != Options.RES_NONE) {
        request.placeholder(options.loadingResId);
    }
    if (options.loadErrorResId != Options.RES_NONE) {
        request.error(options.loadErrorResId);
    }

    wrapScaleType(request, options)
            .diskCacheStrategy(DiskCacheStrategy.SOURCE)
            .crossFade()
            .into(new SimpleTarget<GlideBitmapDrawable>() {

                @Override
                public void onLoadFailed(Exception e, Drawable errorDrawable) {
                    super.onLoadFailed(e, errorDrawable);
                    if (callback != null) {
                        callback.onLoadFailed(e);
                    }
                }

                @Override
                public void onResourceReady(GlideBitmapDrawable resource, GlideAnimation<? super GlideBitmapDrawable> glideAnimation) {
                    if (resource != null && resource.getBitmap() != null) {
                        if (callback != null) {
                            callback.onLoadReady(resource.getBitmap());
                        }
                    }
                }

            });
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:37,代码来源:GlideLoader.java

示例2: load

import com.bumptech.glide.DrawableTypeRequest; //导入方法依赖的package包/类
private void load(DrawableTypeRequest request, ImageView target, Options options) {
    if (options == null) options = Options.defaultOptions();

    if (options.loadingResId != Options.RES_NONE) {
        request.placeholder(options.loadingResId);
    }
    if (options.loadErrorResId != Options.RES_NONE) {
        request.error(options.loadErrorResId);
    }

    wrapScaleType(request, options)
            .diskCacheStrategy(DiskCacheStrategy.SOURCE)
            .crossFade()
            .into(target);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:16,代码来源:GlideLoader.java

示例3: loadNet

import com.bumptech.glide.DrawableTypeRequest; //导入方法依赖的package包/类
@Override
public void loadNet(Context context, String url, Options options, final LoadCallback callback) {
    DrawableTypeRequest request = getRequestManager(context).load(url);
    if (options == null) options = Options.defaultOptions();

    if (options.loadingResId != Options.RES_NONE) {
        request.placeholder(options.loadingResId);
    }
    if (options.loadErrorResId != Options.RES_NONE) {
        request.error(options.loadErrorResId);
    }

    request.diskCacheStrategy(DiskCacheStrategy.SOURCE)
            .crossFade()
            .into(new SimpleTarget<GlideBitmapDrawable>() {

                @Override
                public void onLoadFailed(Exception e, Drawable errorDrawable) {
                    super.onLoadFailed(e, errorDrawable);
                    if (callback != null) {
                        callback.onLoadFailed(e);
                    }
                }

                @Override
                public void onResourceReady(GlideBitmapDrawable resource, GlideAnimation<? super GlideBitmapDrawable> glideAnimation) {
                    if (resource != null && resource.getBitmap() != null) {
                        if (callback != null) {
                            callback.onLoadReady(resource.getBitmap());
                        }
                    }
                }

            });
}
 
开发者ID:lzmlsfe,项目名称:19porn,代码行数:36,代码来源:GlideLoader.java

示例4: load

import com.bumptech.glide.DrawableTypeRequest; //导入方法依赖的package包/类
private void load(DrawableTypeRequest request, ImageView target, Options options) {
    if (options == null) options = Options.defaultOptions();

    if (options.loadingResId != Options.RES_NONE) {
        request.placeholder(options.loadingResId);
    }
    if (options.loadErrorResId != Options.RES_NONE) {
        request.error(options.loadErrorResId);
    }
    request.diskCacheStrategy(DiskCacheStrategy.SOURCE)
            .crossFade()
            .into(target);
}
 
开发者ID:lzmlsfe,项目名称:19porn,代码行数:14,代码来源:GlideLoader.java

示例5: load

import com.bumptech.glide.DrawableTypeRequest; //导入方法依赖的package包/类
private void load(DrawableTypeRequest request, ImageView target, Options options) {
    if (options == null) options = Options.defaultOptions();

    if (options.loadingResId != Options.RES_NONE) {
        request.placeholder(options.loadingResId);
    }
    if (options.loadErrorResId != Options.RES_NONE) {
        request.error(options.loadErrorResId);
    }
    request.crossFade().into(target);
}
 
开发者ID:xiaoyaoyou1212,项目名称:XSnow,代码行数:12,代码来源:GlideLoader.java

示例6: onPrepareRequest

import com.bumptech.glide.DrawableTypeRequest; //导入方法依赖的package包/类
/**
 * Prepares loading request with configuration based on this task's parameters.
 *
 * @param requestManager Manager used to create the request.
 * @return Prepared image loading request to be executed.
 */
@NonNull
protected DrawableTypeRequest<String> onPrepareRequest(@NonNull RequestManager requestManager) {
	final DrawableTypeRequest<String> request = requestManager.load(mTarget);
	if (mPlaceholderRes != NO_RESOURCE_ID) request.error(mPlaceholderRes);
	if (mPlaceholder != null) request.error(mPlaceholder);
	if (mErrorRes != NO_RESOURCE_ID) request.placeholder(mErrorRes);
	if (mError != null) request.placeholder(mError);
	if (mTransformation != null) request.transform(mTransformation);
	if (hasRequest(REQUEST_DO_NOT_ANIMATE)) request.dontAnimate();
	return request;
}
 
开发者ID:albedinsky,项目名称:android_image_loader,代码行数:18,代码来源:ImageTask.java


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