Java Code Examples for com.nostra13.universalimageloader.core.assist.LoadedFrom

The following examples show how to use com.nostra13.universalimageloader.core.assist.LoadedFrom. These examples are extracted from open source projects. 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 Project: MiBandDecompiled   Source File: l.java    License: Apache License 2.0 6 votes vote down vote up
public l(i i1, k k1, Handler handler)
{
    K = LoadedFrom.NETWORK;
    z = i1;
    A = k1;
    B = handler;
    C = i1.a;
    D = C.p;
    E = C.s;
    F = C.t;
    G = C.q;
    a = k1.a;
    H = k1.b;
    b = k1.c;
    I = k1.d;
    c = k1.e;
    d = k1.f;
    e = k1.g;
    J = c.a();
}
 
Example 2
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;
    }
}
 
Example 3
Source Project: scissors   Source File: UILFillViewportDisplayer.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public void display(Bitmap source, ImageAware imageAware, LoadedFrom loadedFrom) {
    int sourceWidth = source.getWidth();
    int sourceHeight = source.getHeight();

    Rect target = CropViewExtensions.computeTargetSize(sourceWidth, sourceHeight, viewportWidth, viewportHeight);
    final Bitmap result = Bitmap.createScaledBitmap(
            source,
            target.width(),
            target.height(),
            true);

    if (result != source) {
        source.recycle();
    }

    imageAware.setImageBitmap(result);
}
 
Example 4
Source Project: candybar   Source File: RoundedBitmapDisplayer.java    License: 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.");
    }

    imageAware.setImageDrawable(new RoundedDrawable(bitmap, cornerRadius, margin));
}
 
Example 5
Source Project: candybar   Source File: RoundedVignetteBitmapDisplayer.java    License: 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.");
    }

    imageAware.setImageDrawable(new RoundedVignetteDrawable(bitmap, cornerRadius, margin));
}
 
Example 6
Source Project: candybar   Source File: FadeInBitmapDisplayer.java    License: 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 Project: candybar   Source File: CircleBitmapDisplayer.java    License: 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.");
    }

    imageAware.setImageDrawable(new CircleDrawable(bitmap, strokeColor, strokeWidth));
}
 
Example 8
Source Project: candybar   Source File: ProcessAndDisplayImageTask.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void run() {
    L.d(LOG_POSTPROCESS_IMAGE, imageLoadingInfo.memoryCacheKey);

    BitmapProcessor processor = imageLoadingInfo.options.getPostProcessor();
    Bitmap processedBitmap = processor.process(bitmap);
    DisplayBitmapTask displayBitmapTask = new DisplayBitmapTask(processedBitmap, imageLoadingInfo, engine,
            LoadedFrom.MEMORY_CACHE);
    LoadAndDisplayImageTask.runTask(displayBitmapTask, imageLoadingInfo.options.isSyncLoading(), handler, engine);
}
 
Example 9
Source Project: candybar   Source File: DisplayBitmapTask.java    License: Apache License 2.0 5 votes vote down vote up
public DisplayBitmapTask(Bitmap bitmap, ImageLoadingInfo imageLoadingInfo, ImageLoaderEngine engine,
                         LoadedFrom loadedFrom) {
    this.bitmap = bitmap;
    imageUri = imageLoadingInfo.uri;
    imageAware = imageLoadingInfo.imageAware;
    memoryCacheKey = imageLoadingInfo.memoryCacheKey;
    displayer = imageLoadingInfo.options.getDisplayer();
    listener = imageLoadingInfo.listener;
    this.engine = engine;
    this.loadedFrom = loadedFrom;
}
 
Example 10
Source Project: fitness_Android   Source File: SimpleImageDisplayer.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public Bitmap display(Bitmap bitmap, ImageView imageView,
		LoadedFrom loadedFrom) {
	// TODO Auto-generated method stub
	if (bitmap != null) {
		bitmap = ImageUtils.resizeImageByWidth(bitmap, targetWidth);
	}
	imageView.setImageBitmap(bitmap);
	return bitmap;
}
 
Example 11
Source Project: letv   Source File: RoundedBitmapDisplayer.java    License: Apache License 2.0 5 votes vote down vote up
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.");
}
 
Example 12
Source Project: letv   Source File: RoundedVignetteBitmapDisplayer.java    License: Apache License 2.0 5 votes vote down vote up
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.");
}
 
Example 13
Source Project: letv   Source File: DisplayBitmapTask.java    License: Apache License 2.0 5 votes vote down vote up
public DisplayBitmapTask(Bitmap bitmap, ImageLoadingInfo imageLoadingInfo, ImageLoaderEngine engine, LoadedFrom loadedFrom) {
    this.bitmap = bitmap;
    this.imageUri = imageLoadingInfo.uri;
    this.imageAware = imageLoadingInfo.imageAware;
    this.memoryCacheKey = imageLoadingInfo.memoryCacheKey;
    this.displayer = imageLoadingInfo.options.getDisplayer();
    this.listener = imageLoadingInfo.listener;
    this.engine = engine;
    this.loadedFrom = loadedFrom;
}
 
Example 14
Source Project: sctalk   Source File: CircleBitmapDisplayer.java    License: 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 15
Source Project: mobile-manager-tool   Source File: RoundedBitmapDisplayer.java    License: MIT License 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.");
	}

	imageAware.setImageDrawable(new RoundedDrawable(bitmap, cornerRadius, margin));
}
 
Example 16
@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));
}
 
Example 17
Source Project: mobile-manager-tool   Source File: FadeInBitmapDisplayer.java    License: 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 18
Source Project: mobile-manager-tool   Source File: ProcessAndDisplayImageTask.java    License: MIT License 5 votes vote down vote up
@Override
public void run() {
	L.d(LOG_POSTPROCESS_IMAGE, imageLoadingInfo.memoryCacheKey);

	BitmapProcessor processor = imageLoadingInfo.options.getPostProcessor();
	Bitmap processedBitmap = processor.process(bitmap);
	com.nostra13.universalimageloader.core.DisplayBitmapTask displayBitmapTask = new com.nostra13.universalimageloader.core.DisplayBitmapTask(processedBitmap, imageLoadingInfo, engine,
			LoadedFrom.MEMORY_CACHE);
	com.nostra13.universalimageloader.core.LoadAndDisplayImageTask.runTask(displayBitmapTask, imageLoadingInfo.options.isSyncLoading(), handler, engine);
}
 
Example 19
Source Project: mobile-manager-tool   Source File: DisplayBitmapTask.java    License: MIT License 5 votes vote down vote up
public DisplayBitmapTask(Bitmap bitmap, com.nostra13.universalimageloader.core.ImageLoadingInfo imageLoadingInfo, com.nostra13.universalimageloader.core.ImageLoaderEngine engine,
		LoadedFrom loadedFrom) {
	this.bitmap = bitmap;
	imageUri = imageLoadingInfo.uri;
	imageAware = imageLoadingInfo.imageAware;
	memoryCacheKey = imageLoadingInfo.memoryCacheKey;
	displayer = imageLoadingInfo.options.getDisplayer();
	listener = imageLoadingInfo.listener;
	this.engine = engine;
	this.loadedFrom = loadedFrom;
}
 
Example 20
@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));
}
 
Example 21
@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));
}
 
Example 22
@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, margin));
}
 
Example 23
@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 24
@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, margin, border));
}
 
Example 25
@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));
}
 
Example 26
@Override
public void run() {
	L.d(LOG_POSTPROCESS_IMAGE, imageLoadingInfo.memoryCacheKey);

	BitmapProcessor processor = imageLoadingInfo.options.getPostProcessor();
	Bitmap processedBitmap = processor.process(bitmap);
	DisplayBitmapTask displayBitmapTask = new DisplayBitmapTask(processedBitmap, imageLoadingInfo, engine,
			LoadedFrom.MEMORY_CACHE);
	LoadAndDisplayImageTask.runTask(displayBitmapTask, imageLoadingInfo.options.isSyncLoading(), handler, engine);
}
 
Example 27
public DisplayBitmapTask(Bitmap bitmap, ImageLoadingInfo imageLoadingInfo, ImageLoaderEngine engine,
		LoadedFrom loadedFrom) {
	this.bitmap = bitmap;
	imageUri = imageLoadingInfo.uri;
	imageAware = imageLoadingInfo.imageAware;
	memoryCacheKey = imageLoadingInfo.memoryCacheKey;
	displayer = imageLoadingInfo.options.getDisplayer();
	listener = imageLoadingInfo.listener;
	this.engine = engine;
	this.loadedFrom = loadedFrom;
}
 
Example 28
Source Project: WliveTV   Source File: RoundedBitmapDisplayer.java    License: 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.");
	}

	imageAware.setImageDrawable(new RoundedDrawable(bitmap, cornerRadius, margin));
}
 
Example 29
Source Project: WliveTV   Source File: RoundedVignetteBitmapDisplayer.java    License: 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.");
	}

	imageAware.setImageDrawable(new RoundedVignetteDrawable(bitmap, cornerRadius, margin));
}
 
Example 30
Source Project: WliveTV   Source File: FadeInBitmapDisplayer.java    License: 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);
	}
}