本文整理汇总了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);
}
示例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);
}
}
示例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);
}
示例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);
}
示例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));
}
示例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));
}
示例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);
}
}
示例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));
}
示例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;
}
示例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);
}
示例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.");
}
示例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.");
}
示例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;
}
示例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));
}
示例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));
}