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

The following examples show how to use com.nostra13.universalimageloader.core.assist.LoadedFrom. 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: l.java    From MiBandDecompiled with 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
Source File: BraceletImageLoader$RoundBitmapDisplayer.java    From MiBandDecompiled with Apache License 2.0 6 votes vote down vote up
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 File: UILFillViewportDisplayer.java    From scissors with 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 File: RoundedVignetteBitmapDisplayer.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) {
	if (!(imageAware instanceof ImageViewAware)) {
		throw new IllegalArgumentException("ImageAware should wrap ImageView. ImageViewAware is expected.");
	}

	imageAware.setImageDrawable(new RoundedVignetteDrawable(bitmap, cornerRadius, margin));
}
 
Example #5
Source File: b.java    From MiBandDecompiled with Apache License 2.0 5 votes vote down vote up
public b(Bitmap bitmap, k k1, i l, LoadedFrom loadedfrom)
{
    d = bitmap;
    e = k1.a;
    f = k1.c;
    g = k1.b;
    h = k1.e.getDisplayer();
    i = k1.f;
    j = l;
    k = loadedfrom;
}
 
Example #6
Source File: DisplayBitmapTask.java    From Android-Universal-Image-Loader-Modify with Apache License 2.0 5 votes vote down vote up
/**
 * 图片显示任务  封装了图片加载显示相关信息
 * @param bitmap                下载成功的图片
 * @param imageLoadingInfo      图片加载相关信息
 * @param engine                图片加载引擎
 * @param loadedFrom            图片加载来源
 */
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 #7
Source File: DisplayBitmapTask.java    From android-open-project-demo with 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 #8
Source File: ProcessAndDisplayImageTask.java    From android-open-project-demo with 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 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 #10
Source File: q.java    From MiBandDecompiled with Apache License 2.0 5 votes vote down vote up
public void run()
{
    Object aobj[] = new Object[1];
    aobj[0] = d.b;
    L.d("PostProcess image before displaying [%s]", aobj);
    l.a(new b(d.e.getPostProcessor().process(c), d, b, LoadedFrom.MEMORY_CACHE), d.e.a(), e, b);
}
 
Example #11
Source File: RoundedBitmapDisplayer.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) {
	if (!(imageAware instanceof ImageViewAware)) {
		throw new IllegalArgumentException("ImageAware should wrap ImageView. ImageViewAware is expected.");
	}

	imageAware.setImageDrawable(new RoundedDrawable(bitmap, cornerRadius, margin));
}
 
Example #12
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 #13
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 #14
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 #15
Source File: RoundedBitmapDisplayer.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.");
	}

	imageAware.setImageDrawable(new RoundedDrawable(bitmap, cornerRadius, margin));
}
 
Example #16
Source File: RoundedVignetteBitmapDisplayer.java    From Android-Universal-Image-Loader-Modify with Apache License 2.0 5 votes vote down vote up
/**
 * 进行创建合适的圆角进行显示
 * @param bitmap
 * @param imageAware
 * @param loadedFrom
 */
@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 File: CircleBitmapDisplayer.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) {
	if (!(imageAware instanceof ImageViewAware)) {
		throw new IllegalArgumentException("ImageAware should wrap ImageView. ImageViewAware is expected.");
	}

	imageAware.setImageDrawable(new CircleDrawable(bitmap, strokeColor, strokeWidth));
}
 
Example #18
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 #19
Source File: RoundedVignetteBitmapDisplayer.java    From MiBandDecompiled with Apache License 2.0 5 votes vote down vote up
public void display(Bitmap bitmap, ImageAware imageaware, LoadedFrom loadedfrom)
{
    if (!(imageaware instanceof ImageViewAware))
    {
        throw new IllegalArgumentException("ImageAware should wrap ImageView. ImageViewAware is expected.");
    } else
    {
        imageaware.setImageDrawable(new RoundedVignetteDrawable(bitmap, cornerRadius, margin));
        return;
    }
}
 
Example #20
Source File: RoundedBitmapDisplayer.java    From MiBandDecompiled with Apache License 2.0 5 votes vote down vote up
public void display(Bitmap bitmap, ImageAware imageaware, LoadedFrom loadedfrom)
{
    if (!(imageaware instanceof ImageViewAware))
    {
        throw new IllegalArgumentException("ImageAware should wrap ImageView. ImageViewAware is expected.");
    } else
    {
        imageaware.setImageDrawable(new RoundedDrawable(bitmap, cornerRadius, margin));
        return;
    }
}
 
Example #21
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 #22
Source File: DisplayBitmapTask.java    From WliveTV with 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 #23
Source File: ProcessAndDisplayImageTask.java    From WliveTV with 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 #24
Source File: CircleBitmapDisplayer.java    From WliveTV 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.");
	}

	imageAware.setImageDrawable(new CircleDrawable(bitmap, strokeColor, strokeWidth));
}
 
Example #25
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 #26
Source File: RoundedVignetteBitmapDisplayer.java    From WliveTV 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.");
	}

	imageAware.setImageDrawable(new RoundedVignetteDrawable(bitmap, cornerRadius, margin));
}
 
Example #27
Source File: RoundedBitmapDisplayer.java    From candybar 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.");
    }

    imageAware.setImageDrawable(new RoundedDrawable(bitmap, cornerRadius, margin));
}
 
Example #28
Source File: DisplayBitmapTask.java    From BigApp_WordPress_Android with 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 #29
Source File: ProcessAndDisplayImageTask.java    From BigApp_WordPress_Android with 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 #30
Source File: RoundedBitmapDisplayer.java    From WliveTV 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.");
	}

	imageAware.setImageDrawable(new RoundedDrawable(bitmap, cornerRadius, margin));
}