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


Java ImageViewAware类代码示例

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


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

示例1: tryLoadBitmap

import com.nostra13.universalimageloader.core.imageaware.ImageViewAware; //导入依赖的package包/类
Bitmap tryLoadBitmap(ImageViewAware imageAware) {
    Bitmap bitmap = null;
    try {
        java.io.File imageFile = diskCache.get(getMessage().get_id());
        if (imageFile != null && imageFile.exists() && imageFile.length() > 0) {
            ViewScaleType viewScaleType = imageAware.getScaleType();
            ImageSize imageSize = ImageSizeUtils.defineTargetSizeForView(imageAware, new ImageSize(MainApp.CONTEXT.getResources().getDisplayMetrics().widthPixels, MainApp.CONTEXT.getResources().getDisplayMetrics().heightPixels));
            ImageDecodingInfo decodingInfo = new ImageDecodingInfo(getMessage().get_id(),
                    ImageDownloader.Scheme.FILE.wrap(imageFile.getAbsolutePath()), getMessage().get_id(), imageSize, viewScaleType,
                    new BaseImageDownloader(MainApp.CONTEXT), options);
            bitmap = decoder.decode(decodingInfo);
            MainApp.memoryCache.put(getMessage().get_id(), bitmap);
        }
    } catch (Exception ignored) {
        ignored.printStackTrace();
    }
    return bitmap;
}
 
开发者ID:jianliaoim,项目名称:talk-android,代码行数:19,代码来源:VideoRow.java

示例2: getView

import com.nostra13.universalimageloader.core.imageaware.ImageViewAware; //导入依赖的package包/类
@Override
public View getView(int i, View convertView, ViewGroup viewGroup) {
    ViewHolder viewHolder;
    if (convertView == null || convertView.getTag() == null) {
        viewHolder = new ViewHolder();
        convertView = LayoutInflater.from(context).inflate(FakeR.getId(context, "layout", "item_albumfoler"), null);
        viewHolder.imageView = (ImageView) convertView.findViewById(FakeR.getId(context, "id", "imageView"));
        viewHolder.textView = (TextView) convertView.findViewById(FakeR.getId(context, "id", "textview"));
        convertView.setTag(viewHolder);
    } else {
        viewHolder = (ViewHolder) convertView.getTag();
    }
    String name = folderNames.get(i);
    List<LocalImageHelper.LocalFile> files = folders.get(name);
    viewHolder.textView.setText(name + "(" + files.size() + ")");
    if (files.size() > 0) {
        ImageLoader.getInstance().displayImage(files.get(0).getThumbnailUri(), new ImageViewAware(viewHolder.imageView), options,
                null, null, files.get(0).getOrientation());
    }
    return convertView;
}
 
开发者ID:giantss,项目名称:com.giants.multiimagespicker,代码行数:22,代码来源:LocalAlbum.java

示例3: load

import com.nostra13.universalimageloader.core.imageaware.ImageViewAware; //导入依赖的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

示例4: display

import com.nostra13.universalimageloader.core.imageaware.ImageViewAware; //导入依赖的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));
	
	if ((animateFromNetwork && loadedFrom == LoadedFrom.NETWORK) ||
			(animateFromDisk && loadedFrom == LoadedFrom.DISC_CACHE) ||
			(animateFromMemory && loadedFrom == LoadedFrom.MEMORY_CACHE)) {
		animate(imageAware.getWrappedView(), durationMillis);
	}
}
 
开发者ID:x251089003,项目名称:EveryXDay,代码行数:17,代码来源:AnimatioinAndCornerBitmapDisplayer.java

示例5: display

import com.nostra13.universalimageloader.core.imageaware.ImageViewAware; //导入依赖的package包/类
public void display(Bitmap bitmap, ImageAware imageaware, LoadedFrom loadedfrom)
{
    if (!(imageaware instanceof ImageViewAware))
    {
        throw new IllegalArgumentException("ImageAware should wrap ImageView. ImageViewAware is expected.");
    }
    Bitmap bitmap1 = Util.clipToRoundBitmap(bitmap);
    ImageView imageview = (ImageView)imageaware.getWrappedView();
    if (bitmap1 == null || imageview == null)
    {
        return;
    } else
    {
        imageview.setBackground(new BitmapDrawable(imageview.getResources(), bitmap1));
        return;
    }
}
 
开发者ID:vishnudevk,项目名称:MiBandDecompiled,代码行数:18,代码来源:BraceletImageLoader$RoundBitmapDisplayer.java

示例6: drawImageIfCacheHasImage

import com.nostra13.universalimageloader.core.imageaware.ImageViewAware; //导入依赖的package包/类
private boolean drawImageIfCacheHasImage(BitmapInfo bitmapInfo, ImageView imageView, int defaultResource, boolean drawRound){
	ImageViewAware imageViewAware = new ImageViewAware(imageView, false);
	if(urlCacheMap.containsKey(bitmapInfo)){
		Bitmap bitmap = urlCacheMap.get(bitmapInfo);
		if(bitmap.isRecycled() == false){
			if(drawRound){
				roundDisplayer.display(bitmap, imageViewAware, null);
			}else{
				displayer.display(bitmap, imageViewAware, null);
			}
			if(localAnimDoneCache.containsKey(bitmapInfo) == false){
				localAnimDoneCache.put(bitmapInfo, true);
				Animation anim = AnimationUtils.loadAnimation(this, R.anim.oto_fadein);
				imageView.startAnimation(anim);
			}
		}else{
			imageView.setImageResource(defaultResource);
		}
		return true;
	}
	return false;
}
 
开发者ID:Easygor,项目名称:OpenTalkOn-Android-Chat-API,代码行数:23,代码来源:ImageCacheActivity.java

示例7: dataToLayout

import com.nostra13.universalimageloader.core.imageaware.ImageViewAware; //导入依赖的package包/类
public void dataToLayout(){
	if(is_my_info){
		if(user_info.getImagePath().length() != 0){
			String img_path = TASatelite.makeImageUrl(user_info.getImagePath());
			image.setImageResource(R.drawable.oto_friend_img_01);
			OTOApp.getInstance().getImageDownloader().requestImgDownload(img_path, new TAImageDataHandler() {
				@Override public void onHttpImagePacketReceived(String url, Bitmap bitmap) {
					roundDisplayer.display(bitmap, new ImageViewAware(image), null);
				}
				@Override public void onHttpImageException(Exception ex) {
					image.setImageResource(R.drawable.oto_friend_img_01);
				}
			});
		}else{
			image.setImageResource(R.drawable.oto_friend_img_01);
		}
		prevNickName = user_info.getNickName();
		nickName.setText(user_info.getNickName());
		introduce.setText(user_info.getIntroduce());
	}
}
 
开发者ID:Easygor,项目名称:OpenTalkOn-Android-Chat-API,代码行数:22,代码来源:OTSettingMyInfo.java

示例8: display

import com.nostra13.universalimageloader.core.imageaware.ImageViewAware; //导入依赖的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

示例9: display

import com.nostra13.universalimageloader.core.imageaware.ImageViewAware; //导入依赖的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

示例10: display

import com.nostra13.universalimageloader.core.imageaware.ImageViewAware; //导入依赖的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

示例11: display

import com.nostra13.universalimageloader.core.imageaware.ImageViewAware; //导入依赖的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

示例12: setUp

import com.nostra13.universalimageloader.core.imageaware.ImageViewAware; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
	mActivity = new Activity();

	// Make and set view with some prelim values to test
	mView = new TestImageView(mActivity);
	mView.setLayoutParams(new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
	mView.measure(View.MeasureSpec.makeMeasureSpec(250, View.MeasureSpec.EXACTLY), View.MeasureSpec.makeMeasureSpec(250, View.MeasureSpec.EXACTLY));

	mImageAware = new ImageViewAware(mView);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:12,代码来源:ImageSizeTest.java

示例13: display

import com.nostra13.universalimageloader.core.imageaware.ImageViewAware; //导入依赖的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

示例14: display

import com.nostra13.universalimageloader.core.imageaware.ImageViewAware; //导入依赖的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

示例15: display

import com.nostra13.universalimageloader.core.imageaware.ImageViewAware; //导入依赖的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


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