Java 类com.nostra13.universalimageloader.core.display.BitmapDisplayer 实例源码

项目:ShortcutMenu    文件:XBitmapOptions.java   
private XBitmapOptions(int iamgeDefault,BitmapDisplayer bitmapDisplayer) {
    this.iamgeDefault = iamgeDefault;
    this.imageResOnLoading = iamgeDefault;
    this.imageResForEmptyUri = iamgeDefault;
    this.imageResOnFail = iamgeDefault;
    this.bitmapDisplayer = bitmapDisplayer;
}
项目:ShortcutMenu    文件:BitmapUtils.java   
/**
 *
 * @param url
 * @param pic
 * @param radius 不需要缩放
 * @param borderColor
 * @param borderWidth 不需要缩放
 */
public void loadRoundBorderImage(String url, ImageView pic,int defaultImg, int radius, int borderColor, int borderWidth) {
    url = resizeUrl(pic, url);
    if (isLoad(pic,url)) {
        DisplayImageOptions options = BitmapOptions.getRoundBorderOpt(0, ScreenUtil.getScalePxValue(radius), borderColor, ScreenUtil.getScalePxValue(borderWidth));
        BitmapDisplayer displayer = options.getDisplayer();
        ImageLoader.getInstance().displayImage(url, pic,options,getRounderImageLoaderListener(displayer,defaultImg));
    }
}
项目:GifImageLoader    文件:ImageLoadingInfo.java   
public ImageLoadingInfo(String uri, ImageAware imageAware, ImageSize targetSize, String memoryCacheKey,
    DisplayImageOptions options, ImageLoadingListener listener,
    ImageLoadingProgressListener progressListener, ReentrantLock loadFromUriLock) {
this.uri = uri;
this.imageAware = imageAware;
this.targetSize = targetSize;
this.options = options;
this.listener = listener;
this.progressListener = progressListener;
this.loadFromUriLock = loadFromUriLock;
this.memoryCacheKey = memoryCacheKey;

      mFileTypeStatus = BitmapDisplayer.FILE_TYPE_UNDEFINE;
      mFilePath = null;
  }
项目:ImageLoaderSupportGif    文件:ImageLoadingInfo.java   
public ImageLoadingInfo(String uri, ImageAware imageAware, ImageSize targetSize, String memoryCacheKey,
    DisplayImageOptions options, ImageLoadingListener listener,
    ImageLoadingProgressListener progressListener, ReentrantLock loadFromUriLock) {
this.uri = uri;
this.imageAware = imageAware;
this.targetSize = targetSize;
this.options = options;
this.listener = listener;
this.progressListener = progressListener;
this.loadFromUriLock = loadFromUriLock;
this.memoryCacheKey = memoryCacheKey;

      mFileTypeStatus = BitmapDisplayer.FILE_TYPE_UNDEFINE;
      mFilePath = null;
  }
项目:mobile-manager-tool    文件:ImageLoadUtil.java   
/**
 * 构造图片显示的配置选项
 *
 * @param placeHolderImgRes 默认的占位显示图片
 * @param emptyUrlImgRes    空链接显示的图片
 * @param failedImgRes      加载失败显示的图片
 * @param cacheInMemory     是否内存缓存,图片过大,建议不要内存缓存
 * @return
 */
private static DisplayImageOptions constructDisplayOption(String url, int placeHolderImgRes, int emptyUrlImgRes,
                                                          int failedImgRes, boolean cacheInMemory, BitmapDisplayer displayer) {
    DisplayImageOptions.Builder bulider = new DisplayImageOptions.Builder();
    bulider.cacheOnDisc(true); // 默认开启磁盘缓存 缓存在默认位置
    // /sdcard/Android/data/[package_name]/cache
    bulider.cacheInMemory(cacheInMemory);
    bulider.resetViewBeforeLoading(true);
    bulider.bitmapConfig(Bitmap.Config.RGB_565);
    // bulider.displayer(new FadeInBitmapDisplayer(200));//加载动画
    if (displayer != null) {
        bulider.displayer(displayer);
    }

    if (placeHolderImgRes > 0) {
        bulider.showStubImage(placeHolderImgRes);
    }

    if (emptyUrlImgRes > 0) {
        bulider.showImageForEmptyUri(emptyUrlImgRes);
    }

    if (failedImgRes > 0) {
        bulider.showImageOnFail(failedImgRes);
    }

    return bulider.build();
}
项目:mobile-manager-tool    文件:ImageLoadUtil.java   
/**
 * 加载显示图片
 *
 * @param imageView      显示图片的组件
 * @param url            图片加载的URL
 * @param placeHolderImg 默认的占位显示图片
 * @param emptyUrlImgRes 空链接显示的图片,不定义请置 0
 * @param failedImgRes   加载失败显示的图片,不定义请置 0
 * @param cacheInMemory  是否将图片缓存到内存中 (大图不建议缓存到内存中)
 */
public static void loadImage(ImageView imageView, String url, int placeHolderImg, int emptyUrlImgRes,
                             int failedImgRes, boolean cacheInMemory, BitmapDisplayer displayer) {
    DisplayImageOptions option = constructDisplayOption(url, placeHolderImg, emptyUrlImgRes, failedImgRes,
            cacheInMemory, displayer);
    if (Strings.isEmpty(url)
            || (!url.endsWith(".jpg") && !url.endsWith(".jpeg") && !url.endsWith(".png") && !url.endsWith(".JPG")
            && !url.endsWith(".JPEG") && !url.endsWith(".PNG"))) {
        if (placeHolderImg != 0) {
            imageView.setImageResource(placeHolderImg);
        }
        return;
    }
    imageLoader.displayImage(url, imageView, option);
}
项目:MiBandDecompiled    文件:DisplayImageOptions.java   
public Builder displayer(BitmapDisplayer bitmapdisplayer)
{
    if (bitmapdisplayer == null)
    {
        throw new IllegalArgumentException("displayer can't be null");
    } else
    {
        q = bitmapdisplayer;
        return this;
    }
}
项目:GitHub    文件:DisplayImageOptions.java   
public BitmapDisplayer getDisplayer() {
    return displayer;
}
项目:GitHub    文件:DefaultConfigurationFactory.java   
/** Creates default implementation of {@link BitmapDisplayer} - {@link SimpleBitmapDisplayer} */
public static BitmapDisplayer createBitmapDisplayer() {
    return new SimpleBitmapDisplayer();
}
项目:letv    文件:DisplayImageOptions.java   
public BitmapDisplayer getDisplayer() {
    return this.displayer;
}
项目:letv    文件:DefaultConfigurationFactory.java   
public static BitmapDisplayer createBitmapDisplayer() {
    return new SimpleBitmapDisplayer();
}
项目:letv    文件:LetvCacheMannager.java   
private BitmapDisplayer getDisplayer() {
    if (VERSION.SDK_INT >= 9) {
        return new FadeInBitmapDisplayer(200);
    }
    return new SimpleBitmapDisplayer();
}
项目:ShortcutMenu    文件:XBitmapOptions.java   
public static XBitmapOptions getNewInstance(int iamgeDefault,BitmapDisplayer bitmapDisplayer) {
    return new XBitmapOptions(iamgeDefault,bitmapDisplayer);
}
项目:ShortcutMenu    文件:XBitmapOptions.java   
public BitmapDisplayer getBitmapDisplayer() {
    return bitmapDisplayer;
}
项目:ShortcutMenu    文件:XImageLoaderListener.java   
/**
     * @param view
     * @param status 1-->loading 2-->failed
     */
    private void showImage(View view, int status) {
        try {
            if (view != null && view instanceof ImageView) {
                boolean isShow = false;
                switch (status) {
                    case 1:
                        isShow = options.checkImageResOnLoading();
                        break;
                    case 2:
                        isShow = options.checkImageResOnFail();
                        break;
                }
                if (isShow) {
                    Context context = view.getContext();
                    //得到Resources对象
                    Resources r = context.getResources();
                    Bitmap bmp = null;
                    if (status == 1) {
                        bmp = BitmapFactory.decodeResource(r, options.getImageResOnLoading());
                    } else if (status == 2){
                        bmp = BitmapFactory.decodeResource(r, options.getImageResOnFail());
                    }
                    Drawable drawable = null;
                    if (bmp != null) {
                        switch (type) {
                            case 0:
//                                drawable = new BitmapDrawable(bmp);
                                break;
                            case 1:
                                drawable = new CircleDrawable(bmp);
                                break;
                            case 2:
                                BitmapDisplayer bitmapDisplayer = options.getBitmapDisplayer();
                                if (bitmapDisplayer!=null&& bitmapDisplayer instanceof RoundBorderBitmapDisplayer)
                                    drawable = ((RoundBorderBitmapDisplayer) bitmapDisplayer).getImageDrawable(new ImageViewAware((ImageView) view), bmp);
                                break;
                        }
                    }
                    if (drawable != null) {
                        ((ImageView) view).setImageDrawable(drawable);
                    } else {
                        if (bmp != null) {
                            ((ImageView) view).setImageBitmap(bmp);
                        }
                    }
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
项目:ShortcutMenu    文件:BitmapUtils.java   
private  XImageLoaderListener getRounderImageLoaderListener(BitmapDisplayer displayer,int defaultImageRes) {
    return XImageLoaderListener.getNewInstance(2,XBitmapOptions.getNewInstance(defaultImageRes,displayer));
}
项目:GifImageLoader    文件:DisplayImageOptions.java   
public BitmapDisplayer getDisplayer() {
    return displayer;
}
项目:GifImageLoader    文件:DefaultConfigurationFactory.java   
/** Creates default implementation of {@link BitmapDisplayer} - {@link SimpleBitmapDisplayer} */
public static BitmapDisplayer createBitmapDisplayer() {
    return new SimpleBitmapDisplayer();
}
项目:boohee_v5.6    文件:DisplayImageOptions.java   
public BitmapDisplayer getDisplayer() {
    return this.displayer;
}
项目:boohee_v5.6    文件:DefaultConfigurationFactory.java   
public static BitmapDisplayer createBitmapDisplayer() {
    return new SimpleBitmapDisplayer();
}
项目:ImageLoaderSupportGif    文件:DisplayImageOptions.java   
public BitmapDisplayer getDisplayer() {
    return displayer;
}
项目:ImageLoaderSupportGif    文件:DefaultConfigurationFactory.java   
/** Creates default implementation of {@link BitmapDisplayer} - {@link SimpleBitmapDisplayer} */
public static BitmapDisplayer createBitmapDisplayer() {
    return new SimpleBitmapDisplayer();
}
项目:yun2win-sdk-android    文件:DisplayImageOptions.java   
public BitmapDisplayer getDisplayer() {
    return displayer;
}
项目:yun2win-sdk-android    文件:DefaultConfigurationFactory.java   
/** Creates default implementation of {@link BitmapDisplayer} - {@link SimpleBitmapDisplayer} */
public static BitmapDisplayer createBitmapDisplayer() {
    return new SimpleBitmapDisplayer();
}
项目:android-open-project-demo-master    文件:DisplayImageOptions.java   
public BitmapDisplayer getDisplayer() {
    return displayer;
}
项目:android-open-project-demo-master    文件:DefaultConfigurationFactory.java   
/** Creates default implementation of {@link BitmapDisplayer} - {@link SimpleBitmapDisplayer} */
public static BitmapDisplayer createBitmapDisplayer() {
    return new SimpleBitmapDisplayer();
}
项目:mobile-manager-tool    文件:DisplayImageOptions.java   
public BitmapDisplayer getDisplayer() {
    return displayer;
}
项目:mobile-manager-tool    文件:DefaultConfigurationFactory.java   
/** Creates default implementation of {@link com.nostra13.universalimageloader.core.display.BitmapDisplayer} - {@link com.nostra13.universalimageloader.core.display.SimpleBitmapDisplayer} */
public static BitmapDisplayer createBitmapDisplayer() {
    return new SimpleBitmapDisplayer();
}
项目:BigApp_WordPress_Android    文件:DisplayImageOptions.java   
public BitmapDisplayer getDisplayer() {
    return displayer;
}
项目:BigApp_WordPress_Android    文件:DefaultConfigurationFactory.java   
/** Creates default implementation of {@link BitmapDisplayer} - {@link SimpleBitmapDisplayer} */
public static BitmapDisplayer createBitmapDisplayer() {
    return new SimpleBitmapDisplayer();
}
项目:AyoSunny    文件:DisplayImageOptions.java   
public BitmapDisplayer getDisplayer() {
    return displayer;
}
项目:AyoSunny    文件:DefaultConfigurationFactory.java   
/** Creates default implementation of {@link BitmapDisplayer} - {@link SimpleBitmapDisplayer} */
public static BitmapDisplayer createBitmapDisplayer() {
    return new SimpleBitmapDisplayer();
}
项目:WliveTV    文件:DisplayImageOptions.java   
public BitmapDisplayer getDisplayer() {
    return displayer;
}
项目:WliveTV    文件:DefaultConfigurationFactory.java   
/** Creates default implementation of {@link BitmapDisplayer} - {@link SimpleBitmapDisplayer} */
public static BitmapDisplayer createBitmapDisplayer() {
    return new SimpleBitmapDisplayer();
}
项目:EveryXDay    文件:DisplayImageOptions.java   
public BitmapDisplayer getDisplayer() {
    return displayer;
}
项目:EveryXDay    文件:DefaultConfigurationFactory.java   
/** Creates default implementation of {@link BitmapDisplayer} - {@link SimpleBitmapDisplayer} */
public static BitmapDisplayer createBitmapDisplayer() {
    return new SimpleBitmapDisplayer();
}
项目:https-github.com-nostra13-Android-Universal-Image-Loader    文件:DisplayImageOptions.java   
public BitmapDisplayer getDisplayer() {
    return displayer;
}
项目:https-github.com-nostra13-Android-Universal-Image-Loader    文件:DefaultConfigurationFactory.java   
/** Creates default implementation of {@link BitmapDisplayer} - {@link SimpleBitmapDisplayer} */
public static BitmapDisplayer createBitmapDisplayer() {
    return new SimpleBitmapDisplayer();
}
项目:CouldBooks    文件:DisplayImageOptions.java   
public BitmapDisplayer getDisplayer() {
    return displayer;
}
项目:CouldBooks    文件:DefaultConfigurationFactory.java   
/** Creates default implementation of {@link BitmapDisplayer} - {@link SimpleBitmapDisplayer} */
public static BitmapDisplayer createBitmapDisplayer() {
    return new SimpleBitmapDisplayer();
}