Java Code Examples for com.nostra13.universalimageloader.core.imageaware.ImageAware#setImageBitmap()

The following examples show how to use com.nostra13.universalimageloader.core.imageaware.ImageAware#setImageBitmap() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FadeInBitmapDisplayer.java    From android-open-project-demo with Apache License 2.0 5 votes vote down vote up
@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);
	}
}
 
Example 2
Source File: CircleBitmapDisplayer.java    From moviedb-android with Apache License 2.0 5 votes vote down vote up
@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);
}
 
Example 3
Source File: CircleBitmapDisplayer.java    From sctalk with Apache License 2.0 5 votes vote down vote up
@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);
}
 
Example 4
Source File: FadeInBitmapDisplayer.java    From mobile-manager-tool with MIT License 5 votes vote down vote up
@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);
	}
}
 
Example 5
Source File: FadeInBitmapDisplayer.java    From Android-Universal-Image-Loader-Modify with Apache License 2.0 5 votes vote down vote up
/**
 * 图片进行显示在ImageAware中
 * @param bitmap     原图片
 * @param imageAware 显示进行显示图片的控件 {@linkplain com.nostra13.universalimageloader.core.imageaware.ImageAware Image aware view} to
 *                   display Bitmap
 * @param loadedFrom Source of loaded image   图片来源方式
 */
@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);
	}
}
 
Example 6
Source File: FadeInBitmapDisplayer.java    From BigApp_WordPress_Android with Apache License 2.0 5 votes vote down vote up
@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);
	}
}
 
Example 7
Source File: OldRoundedBitmapDisplayer.java    From Android-Universal-Image-Loader-Modify with Apache License 2.0 5 votes vote down vote up
@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);
}
 
Example 8
Source File: FadeInBitmapDisplayer.java    From WliveTV with Apache License 2.0 5 votes vote down vote up
@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);
	}
}
 
Example 9
Source File: FadeInBitmapDisplayer.java    From candybar with Apache License 2.0 5 votes vote down vote up
@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);
    }
}
 
Example 10
Source File: CircleBitmapDisplayer.java    From Cotable with Apache License 2.0 5 votes vote down vote up
@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);
}
 
Example 11
Source File: FadeInBitmapDisplayer.java    From MiBandDecompiled with Apache License 2.0 5 votes vote down vote up
public void display(Bitmap bitmap, ImageAware imageaware, LoadedFrom loadedfrom)
{
    imageaware.setImageBitmap(bitmap);
    if (b && loadedfrom == LoadedFrom.NETWORK || c && loadedfrom == LoadedFrom.DISC_CACHE || d && loadedfrom == LoadedFrom.MEMORY_CACHE)
    {
        animate(imageaware.getWrappedView(), a);
    }
}
 
Example 12
Source File: SimpleBitmapDisplayer.java    From WliveTV with Apache License 2.0 4 votes vote down vote up
@Override
public void display(Bitmap bitmap, ImageAware imageAware, LoadedFrom loadedFrom) {
	imageAware.setImageBitmap(bitmap);
}
 
Example 13
Source File: SimpleBitmapDisplayer.java    From Android-Universal-Image-Loader-Modify with Apache License 2.0 4 votes vote down vote up
@Override
public void display(Bitmap bitmap, ImageAware imageAware, LoadedFrom loadedFrom) {
	imageAware.setImageBitmap(bitmap);
}
 
Example 14
Source File: SimpleBitmapDisplayer.java    From android-open-project-demo with Apache License 2.0 4 votes vote down vote up
@Override
public void display(Bitmap bitmap, ImageAware imageAware, LoadedFrom loadedFrom) {
	imageAware.setImageBitmap(bitmap);
}
 
Example 15
Source File: SimpleBitmapDisplayer.java    From MiBandDecompiled with Apache License 2.0 4 votes vote down vote up
public void display(Bitmap bitmap, ImageAware imageaware, LoadedFrom loadedfrom)
{
    imageaware.setImageBitmap(bitmap);
}
 
Example 16
Source File: SimpleBitmapDisplayer.java    From BigApp_WordPress_Android with Apache License 2.0 4 votes vote down vote up
@Override
public void display(Bitmap bitmap, ImageAware imageAware, LoadedFrom loadedFrom) {
	imageAware.setImageBitmap(bitmap);
}
 
Example 17
Source File: SimpleBitmapDisplayer.java    From mobile-manager-tool with MIT License 4 votes vote down vote up
@Override
public void display(Bitmap bitmap, ImageAware imageAware, LoadedFrom loadedFrom) {
	imageAware.setImageBitmap(bitmap);
}
 
Example 18
Source File: SimpleBitmapDisplayer.java    From letv with Apache License 2.0 4 votes vote down vote up
public void display(Bitmap bitmap, ImageAware imageAware, LoadedFrom loadedFrom) {
    imageAware.setImageBitmap(bitmap);
}
 
Example 19
Source File: FadeInBitmapDisplayer.java    From letv with Apache License 2.0 4 votes vote down vote up
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);
    }
}
 
Example 20
Source File: SimpleBitmapDisplayer.java    From candybar with Apache License 2.0 4 votes vote down vote up
@Override
public void display(Bitmap bitmap, ImageAware imageAware, LoadedFrom loadedFrom) {
    imageAware.setImageBitmap(bitmap);
}