Java 类com.nostra13.universalimageloader.core.imageaware.ImageAware 实例源码

项目:ShortcutMenu    文件:RoundBorderDrawable.java   
public RoundBorderDrawable(ImageAware imageAware, Bitmap bitmap, int margin, int radius, int borderColor, int borderWidth) {
        this.imageAware = imageAware;
        this.margin = margin;
        this.oBitmap = bitmap;
        this.radius=radius;
        this.borderColor=borderColor;
        this.borderWidth=borderWidth;

        bitmapShader = new BitmapShader(bitmap, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP);

        imagePaint = new Paint();
        imagePaint.setAntiAlias(true);
        imagePaint.setShader(bitmapShader);

        borderPaint = new Paint();
        borderPaint.setStyle(Paint.Style.STROKE);
        borderPaint.setAntiAlias(true);
        borderPaint.setColor(borderColor);
//        borderPaint.setAlpha(Float.valueOf(borderAlpha * ALPHA_MAX).intValue());
        borderPaint.setStrokeWidth(borderWidth*2);

    }
项目:smile-mvp    文件:UILImageLoader.java   
@Override
public void load(String path, int defaultRes, ImageView iv, final AbsImageLoader.ImageLoadingListener listener) {
    if(!TextUtils.isEmpty(path)) {
        if (!path.equals(iv.getTag())) {
            iv.setTag(path);
            ImageAware imageAware = new ImageViewAware(iv, false);
            ImageLoader.getInstance().displayImage(path, imageAware,
                    getDefaultOptions(false, defaultRes), new SimpleImageLoadingListener() {

                        @Override
                        public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) {
                            if(listener!=null){
                                listener.onSuccess(imageUri, view);
                            }
                        }
                    });
        }
    }else{
        iv.setImageResource(defaultRes);
    }
}
项目:GitHub    文件:OldRoundedBitmapDisplayer.java   
@Override
public void display(Bitmap bitmap, ImageAware imageAware, LoadedFrom loadedFrom) {
    if (!(imageAware instanceof ImageViewAware)) {
        throw new IllegalArgumentException("ImageAware should wrap ImageView. ImageViewAware is expected.");
    }
    Bitmap roundedBitmap = roundCorners(bitmap, (ImageViewAware) imageAware, roundPixels);
    imageAware.setImageBitmap(roundedBitmap);
}
项目:GitHub    文件:ImageSizeUtils.java   
/**
 * Defines target size for image aware view. Size is defined by target
 * {@link com.nostra13.universalimageloader.core.imageaware.ImageAware view} parameters, configuration
 * parameters or device display dimensions.<br />
 */
public static ImageSize defineTargetSizeForView(ImageAware imageAware, ImageSize maxImageSize) {
    int width = imageAware.getWidth();
    if (width <= 0) width = maxImageSize.getWidth();

    int height = imageAware.getHeight();
    if (height <= 0) height = maxImageSize.getHeight();

    return new ImageSize(width, height);
}
项目:GitHub    文件:RoundedBitmapDisplayer.java   
@Override
public void display(Bitmap bitmap, ImageAware imageAware, LoadedFrom loadedFrom) {
    if (!(imageAware instanceof ImageViewAware)) {
        throw new IllegalArgumentException("ImageAware should wrap ImageView. ImageViewAware is expected.");
    }

    imageAware.setImageDrawable(new RoundedDrawable(bitmap, cornerRadius, margin));
}
项目:GitHub    文件:RoundedVignetteBitmapDisplayer.java   
@Override
public void display(Bitmap bitmap, ImageAware imageAware, LoadedFrom loadedFrom) {
    if (!(imageAware instanceof ImageViewAware)) {
        throw new IllegalArgumentException("ImageAware should wrap ImageView. ImageViewAware is expected.");
    }

    imageAware.setImageDrawable(new RoundedVignetteDrawable(bitmap, cornerRadius, margin));
}
项目:GitHub    文件:FadeInBitmapDisplayer.java   
@Override
public void display(Bitmap bitmap, ImageAware imageAware, LoadedFrom loadedFrom) {
    imageAware.setImageBitmap(bitmap);

    if ((animateFromNetwork && loadedFrom == LoadedFrom.NETWORK) ||
            (animateFromDisk && loadedFrom == LoadedFrom.DISC_CACHE) ||
            (animateFromMemory && loadedFrom == LoadedFrom.MEMORY_CACHE)) {
        animate(imageAware.getWrappedView(), durationMillis);
    }
}
项目:GitHub    文件:CircleBitmapDisplayer.java   
@Override
public void display(Bitmap bitmap, ImageAware imageAware, LoadedFrom loadedFrom) {
    if (!(imageAware instanceof ImageViewAware)) {
        throw new IllegalArgumentException("ImageAware should wrap ImageView. ImageViewAware is expected.");
    }

    imageAware.setImageDrawable(new CircleDrawable(bitmap, strokeColor, strokeWidth));
}
项目:GitHub    文件: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;
}
项目:letv    文件:ImageSizeUtils.java   
public static ImageSize defineTargetSizeForView(ImageAware imageAware, ImageSize maxImageSize) {
    int width = imageAware.getWidth();
    if (width <= 0) {
        width = maxImageSize.getWidth();
    }
    int height = imageAware.getHeight();
    if (height <= 0) {
        height = maxImageSize.getHeight();
    }
    return new ImageSize(width, height);
}
项目:letv    文件:RoundedBitmapDisplayer.java   
public void display(Bitmap bitmap, ImageAware imageAware, LoadedFrom loadedFrom) {
    if (imageAware instanceof ImageViewAware) {
        imageAware.setImageDrawable(new RoundedDrawable(bitmap, this.cornerRadius, this.margin));
        return;
    }
    throw new IllegalArgumentException("ImageAware should wrap ImageView. ImageViewAware is expected.");
}
项目:letv    文件:RoundedVignetteBitmapDisplayer.java   
public void display(Bitmap bitmap, ImageAware imageAware, LoadedFrom loadedFrom) {
    if (imageAware instanceof ImageViewAware) {
        imageAware.setImageDrawable(new RoundedVignetteDrawable(bitmap, this.cornerRadius, this.margin));
        return;
    }
    throw new IllegalArgumentException("ImageAware should wrap ImageView. ImageViewAware is expected.");
}
项目:letv    文件: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;
}
项目:ShortcutMenu    文件:RoundBorderBitmapDisplayer.java   
@Override
public void display(Bitmap bitmap, ImageAware imageAware, LoadedFrom loadedFrom) {
    if (!(imageAware instanceof ImageViewAware)) {
        throw new IllegalArgumentException("ImageAware should wrap ImageView. ImageViewAware is expected.");
    }
    imageAware.setImageDrawable(getImageDrawable(imageAware,bitmap));
}
项目:ShortcutMenu    文件:CircleBitmapDisplayer.java   
@Override
public void display(Bitmap bitmap, ImageAware imageAware, LoadedFrom loadedFrom) {
    if (!(imageAware instanceof ImageViewAware)) {
        throw new IllegalArgumentException("ImageAware should wrap ImageView. ImageViewAware is expected.");
    }

    imageAware.setImageDrawable(new CircleDrawable(bitmap, margin));
}
项目:GifImageLoader    文件:OldRoundedBitmapDisplayer.java   
@Override
public void display(Bitmap bitmap, ImageAware imageAware, LoadedFrom loadedFrom, int fileTypeStatus, String filepath) {
    if (!(imageAware instanceof ImageViewAware)) {
        throw new IllegalArgumentException("ImageAware should wrap ImageView. ImageViewAware is expected.");
    }
    Bitmap roundedBitmap = roundCorners(bitmap, (ImageViewAware) imageAware, roundPixels);
    imageAware.setImageBitmap(roundedBitmap);
}
项目:GifImageLoader    文件:ImageSizeUtils.java   
/**
 * Defines target size for image aware view. Size is defined by target
 * {@link com.nostra13.universalimageloader.core.imageaware.ImageAware view} parameters, configuration
 * parameters or device display dimensions.<br />
 */
public static ImageSize defineTargetSizeForView(ImageAware imageAware, ImageSize maxImageSize) {
    int width = imageAware.getWidth();
    if (width <= 0) width = maxImageSize.getWidth();

    int height = imageAware.getHeight();
    if (height <= 0) height = maxImageSize.getHeight();

    return new ImageSize(width, height);
}
项目:GifImageLoader    文件:RoundedBitmapDisplayer.java   
@Override
public void display(Bitmap bitmap, ImageAware imageAware, LoadedFrom loadedFrom, int fileTypeStatus, String filepath) {
    if (!(imageAware instanceof ImageViewAware)) {
        throw new IllegalArgumentException("ImageAware should wrap ImageView. ImageViewAware is expected.");
    }
    imageAware.setImageDrawable(new RoundedDrawable(bitmap, cornerRadius, margin));
}
项目:GifImageLoader    文件:RoundedVignetteBitmapDisplayer.java   
@Override
public void display(Bitmap bitmap, ImageAware imageAware, LoadedFrom loadedFrom, int fileTypeStatus, String filepath) {
    if (!(imageAware instanceof ImageViewAware)) {
        throw new IllegalArgumentException("ImageAware should wrap ImageView. ImageViewAware is expected.");
    }
    imageAware.setImageDrawable(new RoundedVignetteDrawable(bitmap, cornerRadius, margin));
}
项目:GifImageLoader    文件:FadeInBitmapDisplayer.java   
@Override
public void display(Bitmap bitmap, ImageAware imageAware, LoadedFrom loadedFrom, int fileTypeStatus, String filepath) {
    imageAware.setImageBitmap(bitmap);
    if ((animateFromNetwork && loadedFrom == LoadedFrom.NETWORK) ||
            (animateFromDisk && loadedFrom == LoadedFrom.DISC_CACHE) ||
            (animateFromMemory && loadedFrom == LoadedFrom.MEMORY_CACHE)) {
        animate(imageAware.getWrappedView(), durationMillis);
    }
}
项目:GifImageLoader    文件:SimpleBitmapDisplayer.java   
@Override
public void display(Bitmap bitmap, ImageAware imageAware, LoadedFrom loadedFrom, int fileTypeStatus, String filepath) {
    if (fileTypeStatus == BitmapDisplayer.FILE_TYPE_GIF_IMAGE && !TextUtils.isEmpty(filepath)) {
        try {
            imageAware.setImageDrawable(new GifDrawable(filepath));
        } catch (IOException e) {
            imageAware.setImageBitmap(bitmap);
        }
    } else {
        imageAware.setImageBitmap(bitmap);
    }
}
项目:GifImageLoader    文件:CircleBitmapDisplayer.java   
@Override
public void display(Bitmap bitmap, ImageAware imageAware, LoadedFrom loadedFrom, int fileTypeStatus, String filepath) {
    if (!(imageAware instanceof ImageViewAware)) {
        throw new IllegalArgumentException("ImageAware should wrap ImageView. ImageViewAware is expected.");
    }

    imageAware.setImageDrawable(new CircleDrawable(bitmap, strokeColor, strokeWidth));
}
项目: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;
  }
项目:boohee_v5.6    文件:ImageSizeUtils.java   
public static ImageSize defineTargetSizeForView(ImageAware imageAware, ImageSize maxImageSize) {
    int width = imageAware.getWidth();
    if (width <= 0) {
        width = maxImageSize.getWidth();
    }
    int height = imageAware.getHeight();
    if (height <= 0) {
        height = maxImageSize.getHeight();
    }
    return new ImageSize(width, height);
}
项目:boohee_v5.6    文件:RoundedBitmapDisplayer.java   
public void display(Bitmap bitmap, ImageAware imageAware, LoadedFrom loadedFrom) {
    if (imageAware instanceof ImageViewAware) {
        imageAware.setImageDrawable(new RoundedDrawable(bitmap, this.cornerRadius, this
                .margin));
        return;
    }
    throw new IllegalArgumentException("ImageAware should wrap ImageView. ImageViewAware is expected.");
}
项目:boohee_v5.6    文件:RoundedVignetteBitmapDisplayer.java   
public void display(Bitmap bitmap, ImageAware imageAware, LoadedFrom loadedFrom) {
    if (imageAware instanceof ImageViewAware) {
        imageAware.setImageDrawable(new RoundedVignetteDrawable(bitmap, this.cornerRadius,
                this.margin));
        return;
    }
    throw new IllegalArgumentException("ImageAware should wrap ImageView. ImageViewAware is " +
            "expected.");
}
项目:boohee_v5.6    文件:FadeInBitmapDisplayer.java   
public void display(Bitmap bitmap, ImageAware imageAware, LoadedFrom loadedFrom) {
    imageAware.setImageBitmap(bitmap);
    if ((this.animateFromNetwork && loadedFrom == LoadedFrom.NETWORK) || ((this
            .animateFromDisk && loadedFrom == LoadedFrom.DISC_CACHE) || (this
            .animateFromMemory && loadedFrom == LoadedFrom.MEMORY_CACHE))) {
        animate(imageAware.getWrappedView(), this.durationMillis);
    }
}
项目:boohee_v5.6    文件:CircleBitmapDisplayer.java   
public void display(Bitmap bitmap, ImageAware imageAware, LoadedFrom loadedFrom) {
    if (imageAware instanceof ImageViewAware) {
        imageAware.setImageDrawable(new CircleDrawable(bitmap, this.strokeColor, this
                .strokeWidth));
        return;
    }
    throw new IllegalArgumentException("ImageAware should wrap ImageView. ImageViewAware is expected.");
}
项目:boohee_v5.6    文件: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;
}
项目:sctalk    文件:CircleBitmapDisplayer.java   
@Override
public void display(Bitmap bitmap, ImageAware imageAware, LoadedFrom loadedFrom) {
    Bitmap output = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), Bitmap.Config.ARGB_4444);

    Canvas canvas = new Canvas(output);

    final int color = 0xff424242;
    final Paint paint = new Paint();
    final Rect rect = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight());

    paint.setAntiAlias(true);
    canvas.drawARGB(0, 0, 0, 0);
    paint.setColor(color);

    //--CROP THE IMAGE
    canvas.drawCircle(bitmap.getWidth() / 2, bitmap.getHeight() / 2, bitmap.getWidth() / 2 - 1, paint);
    paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN));
    canvas.drawBitmap(bitmap, rect, rect, paint);

    //--ADD BORDER IF NEEDED
    if(this.borderWidth > 0){
        final Paint paint2 = new Paint();
        paint2.setAntiAlias(true);
        paint2.setColor(this.borderColor);
        paint2.setStrokeWidth(this.borderWidth);
        paint2.setStyle(Paint.Style.STROKE);
        canvas.drawCircle(bitmap.getWidth() / 2, bitmap.getHeight() / 2, (float) (bitmap.getWidth() / 2 - Math.ceil(this.borderWidth / 2)), paint2);
    }
    imageAware.setImageBitmap(output);
}
项目:ImageLoaderSupportGif    文件:OldRoundedBitmapDisplayer.java   
@Override
   public void display(Bitmap bitmap, ImageAware imageAware, LoadedFrom loadedFrom, int fileTypeStatus, String filepath) {
    if (!(imageAware instanceof ImageViewAware)) {
        throw new IllegalArgumentException("ImageAware should wrap ImageView. ImageViewAware is expected.");
    }
    Bitmap roundedBitmap = roundCorners(bitmap, (ImageViewAware) imageAware, roundPixels);
    imageAware.setImageBitmap(roundedBitmap);
}
项目:ImageLoaderSupportGif    文件:ImageSizeUtils.java   
/**
 * Defines target size for image aware view. Size is defined by target
 * {@link com.nostra13.universalimageloader.core.imageaware.ImageAware view} parameters, configuration
 * parameters or device display dimensions.<br />
 */
public static ImageSize defineTargetSizeForView(ImageAware imageAware, ImageSize maxImageSize) {
    int width = imageAware.getWidth();
    if (width <= 0) width = maxImageSize.getWidth();

    int height = imageAware.getHeight();
    if (height <= 0) height = maxImageSize.getHeight();

    return new ImageSize(width, height);
}
项目:ImageLoaderSupportGif    文件:SimpleBitmapDisplayer.java   
@Override
public void display(Bitmap bitmap, ImageAware imageAware, LoadedFrom loadedFrom, int fileTypeStatus, String filepath) {
    if (fileTypeStatus == BitmapDisplayer.FILE_TYPE_GIF_IMAGE && !TextUtils.isEmpty(filepath)) {
        try {
            imageAware.setImageDrawable(new GifDrawable(filepath));
        } catch (IOException e) {
            imageAware.setImageBitmap(bitmap);
        }
    } else {
        imageAware.setImageBitmap(bitmap);
    }
}
项目: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;
  }
项目:MyTravelingDiary    文件:PickerlImageLoadTool.java   
public static void disPlay(String uri, ImageAware imageAware,int defaultPic){
    DisplayImageOptions options = new DisplayImageOptions.Builder()
    .showImageOnLoading(defaultPic)
    .showImageForEmptyUri(defaultPic)
    .showImageOnFail(defaultPic)
    .cacheInMemory(true)
    .cacheOnDisc(false)
    .bitmapConfig(Bitmap.Config.RGB_565)
    .displayer(new SimpleBitmapDisplayer())
    .build();

    imageLoader.displayImage(uri, imageAware, options);
}
项目:yun2win-sdk-android    文件:ImageSizeUtils.java   
/**
 * Defines target size for image aware view. Size is defined by target
 * {@link ImageAware view} parameters, configuration
 * parameters or device display dimensions.<br />
 */
public static ImageSize defineTargetSizeForView(ImageAware imageAware, ImageSize maxImageSize) {
    int width = imageAware.getWidth();
    if (width <= 0) width = maxImageSize.getWidth();

    int height = imageAware.getHeight();
    if (height <= 0) height = maxImageSize.getHeight();

    return new ImageSize(width, height);
}
项目:yun2win-sdk-android    文件:RoundedBitmapDisplayer.java   
@Override
public void display(Bitmap bitmap, ImageAware imageAware, LoadedFrom loadedFrom) {
    if (!(imageAware instanceof ImageViewAware)) {
        throw new IllegalArgumentException("ImageAware should wrap ImageView. ImageViewAware is expected.");
    }

    imageAware.setImageDrawable(new RoundedDrawable(bitmap, cornerRadius, margin));
}
项目:yun2win-sdk-android    文件:RoundedVignetteBitmapDisplayer.java   
@Override
public void display(Bitmap bitmap, ImageAware imageAware, LoadedFrom loadedFrom) {
    if (!(imageAware instanceof ImageViewAware)) {
        throw new IllegalArgumentException("ImageAware should wrap ImageView. ImageViewAware is expected.");
    }

    imageAware.setImageDrawable(new RoundedVignetteDrawable(bitmap, cornerRadius, margin));
}
项目:yun2win-sdk-android    文件:FadeInBitmapDisplayer.java   
@Override
public void display(Bitmap bitmap, ImageAware imageAware, LoadedFrom loadedFrom) {
    imageAware.setImageBitmap(bitmap);

    if ((animateFromNetwork && loadedFrom == LoadedFrom.NETWORK) ||
            (animateFromDisk && loadedFrom == LoadedFrom.DISC_CACHE) ||
            (animateFromMemory && loadedFrom == LoadedFrom.MEMORY_CACHE)) {
        animate(imageAware.getWrappedView(), durationMillis);
    }
}
项目:WliveTV    文件: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;
}