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