Java 类com.nostra13.universalimageloader.core.DisplayImageOptions.Builder 实例源码

项目:letv    文件:LoadAndDisplayImageTask.java   
private boolean resizeAndSaveImage(int maxWidth, int maxHeight) throws IOException {
    File targetFile = this.configuration.diskCache.get(this.uri);
    if (targetFile == null || !targetFile.exists()) {
        return false;
    }
    Bitmap bmp = this.decoder.decode(new ImageDecodingInfo(this.memoryCacheKey, Scheme.FILE.wrap(targetFile.getAbsolutePath()), this.uri, new ImageSize(maxWidth, maxHeight), ViewScaleType.FIT_INSIDE, getDownloader(), new Builder().cloneFrom(this.options).imageScaleType(ImageScaleType.IN_SAMPLE_INT).build()));
    if (!(bmp == null || this.configuration.processorForDiskCache == null)) {
        L.d(LOG_PROCESS_IMAGE_BEFORE_CACHE_ON_DISK, this.memoryCacheKey);
        bmp = this.configuration.processorForDiskCache.process(bmp);
        if (bmp == null) {
            L.e(ERROR_PROCESSOR_FOR_DISK_CACHE_NULL, this.memoryCacheKey);
        }
    }
    if (bmp == null) {
        return false;
    }
    boolean saved = this.configuration.diskCache.save(this.uri, bmp);
    bmp.recycle();
    return saved;
}
项目:letv    文件:TitlePopupMenu.java   
@SuppressLint({"InflateParams"})
public TitlePopupMenu(Context context, int width, int height) {
    this.LIST_PADDING = 10;
    this.mRect = new Rect();
    this.mLocation = new int[2];
    this.popupGravity = 0;
    this.menus = new ArrayList();
    this.menusAdapter = new MenusAdapter();
    this.mContext = context;
    this.options = new Builder().showImageOnLoading(R.drawable.lemallsdk_icon_default).showImageForEmptyUri(R.drawable.lemallsdk_icon_default).showImageOnFail(R.drawable.lemallsdk_icon_default).cacheInMemory(true).cacheOnDisc(true).bitmapConfig(Config.RGB_565).imageScaleType(ImageScaleType.IN_SAMPLE_INT).displayer(new SimpleBitmapDisplayer()).build();
    setFocusable(true);
    setTouchable(true);
    setOutsideTouchable(true);
    this.mScreenWidth = ScreenUtil.getScreenWidth(this.mContext);
    this.mScreenHeight = ScreenUtil.getScreenHeight(this.mContext);
    setWidth(width);
    setHeight(height);
    setAnimationStyle(R.style.AnimationPreview);
    update();
    setBackgroundDrawable(new BitmapDrawable());
    setContentView(LayoutInflater.from(this.mContext).inflate(R.layout.lemallsdk_title_popup_menu, null));
    initUI();
}
项目:boohee_v5.6    文件:LoadAndDisplayImageTask.java   
private boolean resizeAndSaveImage(int maxWidth, int maxHeight) throws IOException {
    File targetFile = this.configuration.diskCache.get(this.uri);
    if (targetFile == null || !targetFile.exists()) {
        return false;
    }
    Bitmap bmp = this.decoder.decode(new ImageDecodingInfo(this.memoryCacheKey, Scheme.FILE
            .wrap(targetFile.getAbsolutePath()), this.uri, new ImageSize(maxWidth, maxHeight)
            , ViewScaleType.FIT_INSIDE, getDownloader(), new Builder().cloneFrom(this
            .options).imageScaleType(ImageScaleType.IN_SAMPLE_INT).build()));
    if (!(bmp == null || this.configuration.processorForDiskCache == null)) {
        L.d(LOG_PROCESS_IMAGE_BEFORE_CACHE_ON_DISK, this.memoryCacheKey);
        bmp = this.configuration.processorForDiskCache.process(bmp);
        if (bmp == null) {
            L.e(ERROR_PROCESSOR_FOR_DISK_CACHE_NULL, this.memoryCacheKey);
        }
    }
    if (bmp == null) {
        return false;
    }
    boolean saved = this.configuration.diskCache.save(this.uri, bmp);
    bmp.recycle();
    return saved;
}
项目:letv    文件:ImageLoader.java   
public Bitmap loadImageSync(String uri, ImageSize targetImageSize, DisplayImageOptions options) {
    if (options == null) {
        options = this.configuration.defaultDisplayImageOptions;
    }
    options = new Builder().cloneFrom(options).syncLoading(false).build();
    SyncImageLoadingListener listener = new SyncImageLoadingListener();
    loadImage(uri, targetImageSize, options, listener);
    return listener.getLoadedBitmap();
}
项目:boohee_v5.6    文件:ImageLoader.java   
public Bitmap loadImageSync(String uri, ImageSize targetImageSize, DisplayImageOptions
        options) {
    if (options == null) {
        options = this.configuration.defaultDisplayImageOptions;
    }
    options = new Builder().cloneFrom(options).syncLoading(true).build();
    SyncImageLoadingListener listener = new SyncImageLoadingListener();
    loadImage(uri, targetImageSize, options, listener);
    return listener.getLoadedBitmap();
}
项目:boohee_v5.6    文件:PostPicturePreviewAdapter.java   
private void initDisplayOptions() {
    Builder builder = new Builder();
    builder.bitmapConfig(Config.RGB_565).imageScaleType(ImageScaleType.EXACTLY).cacheInMemory
            (true).cacheOnDisk(true).showImageForEmptyUri((int) R.color.in).showImageOnFail(
            (int) R.color.in).showImageOnLoading((int) R.color.in);
    this.mDisplayOptions = builder.build();
}
项目:zone-sdk    文件:ImageLoaderOptionsUtils.java   
public static Builder getNormalOption_NotBuild(){
        if(!initShowImage_Used){
            throw new IllegalStateException("please first use initShowImage method !");
        }
        Builder options = new DisplayImageOptions.Builder();
        if (imageOnLoading!=-1) {
            options.showImageOnLoading(imageOnLoading);
        }
        if (imageForEmptyUri!=-1) {
            options.showImageForEmptyUri(imageForEmptyUri);
        }
        if (imageOnFail!=-1) {
            options.showImageOnFail(imageOnFail);
        }
        options.imageScaleType(ImageScaleType.IN_SAMPLE_INT);
        options.cacheInMemory(true);
        options.cacheOnDisk(true);
        options.bitmapConfig(Bitmap.Config.RGB_565); // 设置图片的解码类型

//      ------------------------可扩展的东西-------------------------------
//      options.considerExifParams(true);  //是否考虑JPEG图像EXIF参数(旋转,翻转)
//      options.decodingOptions(BitmapFactory.Options decodingOptions);//设置图片的解码配置  
//      options.delayBeforeLoading(0);//int delayInMillis为你设置的下载前的延迟时间
//      options.resetViewBeforeLoading(true);//设置图片在下载前是否重置,复位  
//      options.displayer(new RoundedBitmapDisplayer(20))//不推荐用 因为会重新生成 ARGB8888 的图片!!!!是否设置为圆角,弧度为多少  
//      options.displayer(new FadeInBitmapDisplayer(100))//是否图片加载好后渐入的动画时间,可能会出现闪动
        return options;
    }
项目:blippex_android_app    文件:BlippexImageLoader.java   
private static final DisplayImageOptions getDisplayOptions(JSONObject item, boolean preProcess){
    Builder displayOptions = new DisplayImageOptions.Builder()
       .imageScaleType(ImageScaleType.IN_SAMPLE_POWER_OF_2)
    .cacheInMemory()
    .cacheOnDisc();
    return displayOptions.build();
}
项目:letv    文件:LetvCacheMannager.java   
public void init(Context context, LetvThumbnailUtils letvThumbnailUtils) {
    LetvCacheConfiguration.initCacheLibrary(context, letvThumbnailUtils);
    this.options = new Builder().cacheInMemory(true).cacheOnDisk(true).resetViewBeforeLoading(false).displayer(new SimpleBitmapDisplayer()).bitmapConfig(Config.RGB_565).imageScaleType(ImageScaleType.IN_SAMPLE_POWER_OF_2).build();
}
项目:boohee_v5.6    文件:ImageLoaderOptions.java   
public static DisplayImageOptions avatar() {
    return new Builder().cacheOnDisc(true).showImageOnLoading((int) R.drawable.aa0)
            .showImageOnFail((int) R.drawable.aa0).cacheInMemory(true).considerExifParams
                    (true).showImageForEmptyUri((int) R.drawable.aa0).bitmapConfig(Config
                    .RGB_565).build();
}
项目:boohee_v5.6    文件:ImageLoaderOptions.java   
public static DisplayImageOptions global(int drawableId) {
    return new Builder().cacheInMemory(true).cacheOnDisc(true).considerExifParams(true)
            .showImageOnLoading(drawableId).showImageOnFail(drawableId).showImageForEmptyUri
                    (drawableId).imageScaleType(ImageScaleType.IN_SAMPLE_INT).bitmapConfig
                    (Config.ARGB_8888).build();
}
项目:boohee_v5.6    文件:ImageLoaderOptions.java   
public static DisplayImageOptions global(Drawable drawable) {
    return new Builder().cacheInMemory(true).cacheOnDisc(true).considerExifParams(true)
            .showImageOnLoading(drawable).showImageOnFail(drawable).showImageForEmptyUri
                    (drawable).imageScaleType(ImageScaleType.EXACTLY).bitmapConfig(Config
                    .ARGB_8888).build();
}
项目:boohee_v5.6    文件:ImageLoaderOptions.java   
public static DisplayImageOptions uchoiceOption() {
    return new Builder().showImageOnLoading((int) R.drawable.l_).showImageOnFail((int) R
            .drawable.mh).cacheInMemory(false).cacheOnDisc(true).showImageForEmptyUri((int) R
            .drawable.mh).imageScaleType(ImageScaleType.IN_SAMPLE_INT).bitmapConfig(Config
            .ARGB_8888).build();
}
项目:boohee_v5.6    文件:ImageLoaderOptions.java   
public static DisplayImageOptions noImage() {
    return new Builder().cacheOnDisc(true).build();
}