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


Java ImageAware类代码示例

本文整理汇总了Java中com.nostra13.universalimageloader.core.imageaware.ImageAware的典型用法代码示例。如果您正苦于以下问题:Java ImageAware类的具体用法?Java ImageAware怎么用?Java ImageAware使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ImageAware类属于com.nostra13.universalimageloader.core.imageaware包,在下文中一共展示了ImageAware类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: RoundBorderDrawable

import com.nostra13.universalimageloader.core.imageaware.ImageAware; //导入依赖的package包/类
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);

    }
 
开发者ID:qsyj,项目名称:ShortcutMenu,代码行数:23,代码来源:RoundBorderDrawable.java

示例2: load

import com.nostra13.universalimageloader.core.imageaware.ImageAware; //导入依赖的package包/类
@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);
    }
}
 
开发者ID:bodismile,项目名称:smile-mvp,代码行数:22,代码来源:UILImageLoader.java

示例3: display

import com.nostra13.universalimageloader.core.imageaware.ImageAware; //导入依赖的package包/类
@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);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:9,代码来源:OldRoundedBitmapDisplayer.java

示例4: defineTargetSizeForView

import com.nostra13.universalimageloader.core.imageaware.ImageAware; //导入依赖的package包/类
/**
 * 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);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:15,代码来源:ImageSizeUtils.java

示例5: display

import com.nostra13.universalimageloader.core.imageaware.ImageAware; //导入依赖的package包/类
@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));
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:9,代码来源:RoundedBitmapDisplayer.java

示例6: display

import com.nostra13.universalimageloader.core.imageaware.ImageAware; //导入依赖的package包/类
@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));
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:9,代码来源:RoundedVignetteBitmapDisplayer.java

示例7: display

import com.nostra13.universalimageloader.core.imageaware.ImageAware; //导入依赖的package包/类
@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);
	}
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:11,代码来源:FadeInBitmapDisplayer.java

示例8: display

import com.nostra13.universalimageloader.core.imageaware.ImageAware; //导入依赖的package包/类
@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));
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:9,代码来源:CircleBitmapDisplayer.java

示例9: ImageLoadingInfo

import com.nostra13.universalimageloader.core.imageaware.ImageAware; //导入依赖的package包/类
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;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:13,代码来源:ImageLoadingInfo.java

示例10: defineTargetSizeForView

import com.nostra13.universalimageloader.core.imageaware.ImageAware; //导入依赖的package包/类
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);
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:12,代码来源:ImageSizeUtils.java

示例11: display

import com.nostra13.universalimageloader.core.imageaware.ImageAware; //导入依赖的package包/类
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.");
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:8,代码来源:RoundedBitmapDisplayer.java

示例12: display

import com.nostra13.universalimageloader.core.imageaware.ImageAware; //导入依赖的package包/类
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.");
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:8,代码来源:RoundedVignetteBitmapDisplayer.java

示例13: ImageLoadingInfo

import com.nostra13.universalimageloader.core.imageaware.ImageAware; //导入依赖的package包/类
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;
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:11,代码来源:ImageLoadingInfo.java

示例14: display

import com.nostra13.universalimageloader.core.imageaware.ImageAware; //导入依赖的package包/类
@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));
}
 
开发者ID:qsyj,项目名称:ShortcutMenu,代码行数:8,代码来源:RoundBorderBitmapDisplayer.java

示例15: display

import com.nostra13.universalimageloader.core.imageaware.ImageAware; //导入依赖的package包/类
@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));
}
 
开发者ID:qsyj,项目名称:ShortcutMenu,代码行数:9,代码来源:CircleBitmapDisplayer.java


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