Java Code Examples for com.nostra13.universalimageloader.core.listener.ImageLoadingListener

The following examples show how to use com.nostra13.universalimageloader.core.listener.ImageLoadingListener. 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: candybar   Source File: ImageLoadingInfo.java    License: Apache License 2.0 5 votes vote down vote up
public ImageLoadingInfo(String uri, ImageAware imageAware, ImageSize targetSize, String memoryCacheKey,
                        DisplayImageOptions options, ImageLoadingListener listener,
                        ImageLoadingProgressListener progressListener, ReentrantLock loadFromUriLock) {
    this.uri = uri;
    this.imageAware = imageAware;
    this.targetSize = targetSize;
    this.options = options;
    this.listener = listener;
    this.progressListener = progressListener;
    this.loadFromUriLock = loadFromUriLock;
    this.memoryCacheKey = memoryCacheKey;
}
 
Example 2
Source Project: DevUtils   Source File: ImageLoaderUtils.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * 图片显示
 * @param uri       Image Uri
 * @param imageView ImageView
 * @param options   {@link DisplayImageOptions}
 * @param listener  加载监听事件
 */
public static void displayImage(final String uri, final ImageView imageView,
                                final DisplayImageOptions options, final ImageLoadingListener listener) {
    if (imageView != null) {
        if (options != null) {
            ImageLoader.getInstance().displayImage(uri, imageView, options, listener);
        } else {
            ImageLoader.getInstance().displayImage(uri, imageView, listener);
        }
    }
}
 
Example 3
Source Project: letv   Source File: ImageLoader.java    License: Apache License 2.0 5 votes vote down vote up
public void loadImage(String uri, ImageSize targetImageSize, DisplayImageOptions options, ImageLoadingListener listener, ImageLoadingProgressListener progressListener) {
    checkConfiguration();
    if (targetImageSize == null) {
        targetImageSize = this.configuration.getMaxImageSize();
    }
    if (options == null) {
        options = this.configuration.defaultDisplayImageOptions;
    }
    displayImage(uri, new NonViewAware(uri, targetImageSize, ViewScaleType.CROP), options, listener, progressListener);
}
 
Example 4
Source Project: letv   Source File: ImageLoadingInfo.java    License: Apache License 2.0 5 votes vote down vote up
public ImageLoadingInfo(String uri, ImageAware imageAware, ImageSize targetSize, String memoryCacheKey, DisplayImageOptions options, ImageLoadingListener listener, ImageLoadingProgressListener progressListener, ReentrantLock loadFromUriLock) {
    this.uri = uri;
    this.imageAware = imageAware;
    this.targetSize = targetSize;
    this.options = options;
    this.listener = listener;
    this.progressListener = progressListener;
    this.loadFromUriLock = loadFromUriLock;
    this.memoryCacheKey = memoryCacheKey;
}
 
Example 5
Source Project: letv   Source File: LetvCacheMannager.java    License: Apache License 2.0 5 votes vote down vote up
public synchronized void loadImage(String url, ImageView imageView, ImageLoadingListener loadingListener) {
    if (ImageLoader.getInstance().isInited()) {
        if (!(TextUtils.isEmpty(url) || imageView == null)) {
            ImageLoader.getInstance().displayImage(url, imageView, this.options, loadingListener);
        }
    }
}
 
Example 6
Source Project: MiBandDecompiled   Source File: k.java    License: Apache License 2.0 5 votes vote down vote up
public k(String s, ImageAware imageaware, ImageSize imagesize, String s1, DisplayImageOptions displayimageoptions, ImageLoadingListener imageloadinglistener, ImageLoadingProgressListener imageloadingprogresslistener, 
        ReentrantLock reentrantlock)
{
    a = s;
    c = imageaware;
    d = imagesize;
    e = displayimageoptions;
    f = imageloadinglistener;
    g = imageloadingprogresslistener;
    h = reentrantlock;
    b = s1;
}
 
Example 7
public ImageLoadingInfo(String uri, ImageAware imageAware, ImageSize targetSize, String memoryCacheKey,
		DisplayImageOptions options, ImageLoadingListener listener,
		ImageLoadingProgressListener progressListener, ReentrantLock loadFromUriLock) {
	this.uri = uri;
	this.imageAware = imageAware;
	this.targetSize = targetSize;
	this.options = options;
	this.listener = listener;
	this.progressListener = progressListener;
	this.loadFromUriLock = loadFromUriLock;
	this.memoryCacheKey = memoryCacheKey;
}
 
Example 8
Source Project: BigApp_WordPress_Android   Source File: ImageLoadingInfo.java    License: Apache License 2.0 5 votes vote down vote up
public ImageLoadingInfo(String uri, ImageAware imageAware, ImageSize targetSize, String memoryCacheKey,
		DisplayImageOptions options, ImageLoadingListener listener,
		ImageLoadingProgressListener progressListener, ReentrantLock loadFromUriLock) {
	this.uri = uri;
	this.imageAware = imageAware;
	this.targetSize = targetSize;
	this.options = options;
	this.listener = listener;
	this.progressListener = progressListener;
	this.loadFromUriLock = loadFromUriLock;
	this.memoryCacheKey = memoryCacheKey;
}
 
Example 9
public void displayImage(String imagePath, ImageView imageView,
		ImageLoadingListener listener) {
	if (options_none == null) {
		this.options_none = getOptions().cacheInMemory(false)
				.cacheOnDisk(false).build();
	}
	imageLoader.displayImage(imagePath, imageView, options_none, listener);
}
 
Example 10
public void displayImageWp(String imagePath, ImageView imageView,
		ImageLoadingListener listener) {
	if (options_none == null) {
		this.options_none = getOptionsWp().cacheInMemory(false)
				.cacheOnDisk(false).build();
	}
	imageLoader.displayImage(imagePath, imageView, options_none, listener);
}
 
Example 11
Source Project: MiBandDecompiled   Source File: BraceletImageLoader.java    License: Apache License 2.0 4 votes vote down vote up
public void loadImageAsync(String s, ImageSize imagesize, ImageLoadingListener imageloadinglistener)
{
    b.loadImage(s, imagesize, imageloadinglistener);
}
 
Example 12
Source Project: candybar   Source File: ImageLoader.java    License: Apache License 2.0 4 votes vote down vote up
/**
 * Sets a default loading listener for all display and loading tasks.
 */
public void setDefaultLoadingListener(ImageLoadingListener listener) {
    defaultListener = listener == null ? new SimpleImageLoadingListener() : listener;
}
 
Example 13
Source Project: FimiX8-RE   Source File: ImageLoaderManager.java    License: MIT License 4 votes vote down vote up
public void displayImage(ImageView imageView, String path, ImageLoadingListener listener) {
    if (mLoader != null) {
        mLoader.displayImage(path, imageView, listener);
    }
}
 
Example 14
Source Project: DoraemonKit   Source File: ImageLoaderHook.java    License: Apache License 2.0 4 votes vote down vote up
public static ImageLoadingListener proxy(ImageLoadingListener imageLoadingListener) {
    return new DokitImageLoadingListener(imageLoadingListener);
}
 
Example 15
Source Project: DoraemonKit   Source File: DokitImageLoadingListener.java    License: Apache License 2.0 4 votes vote down vote up
public DokitImageLoadingListener(ImageLoadingListener imageLoadingListener) {
    this.mOriginalImageLoadingListener = imageLoadingListener;
}
 
Example 16
Source Project: MiBandDecompiled   Source File: ImageLoader.java    License: Apache License 2.0 4 votes vote down vote up
public void displayImage(String s, ImageView imageview, ImageLoadingListener imageloadinglistener)
{
    displayImage(s, ((ImageAware) (new ImageViewAware(imageview))), null, imageloadinglistener, null);
}
 
Example 17
Source Project: MiBandDecompiled   Source File: ImageLoader.java    License: Apache License 2.0 4 votes vote down vote up
public void displayImage(String s, ImageAware imageaware, DisplayImageOptions displayimageoptions, ImageLoadingListener imageloadinglistener)
{
    displayImage(s, imageaware, displayimageoptions, imageloadinglistener, null);
}
 
Example 18
Source Project: letv   Source File: ImageLoader.java    License: Apache License 2.0 4 votes vote down vote up
public void displayImage(String uri, ImageAware imageAware, ImageLoadingListener listener) {
    displayImage(uri, imageAware, null, listener, null);
}
 
Example 19
Source Project: letv   Source File: ImageLoader.java    License: Apache License 2.0 4 votes vote down vote up
public void displayImage(String uri, ImageAware imageAware, DisplayImageOptions options, ImageLoadingListener listener) {
    displayImage(uri, imageAware, options, listener, null);
}
 
Example 20
Source Project: letv   Source File: ImageLoader.java    License: Apache License 2.0 4 votes vote down vote up
public void displayImage(String uri, ImageAware imageAware, DisplayImageOptions options, ImageLoadingListener listener, ImageLoadingProgressListener progressListener) {
    checkConfiguration();
    if (imageAware == null) {
        throw new IllegalArgumentException(ERROR_WRONG_ARGUMENTS);
    }
    if (listener == null) {
        listener = this.emptyListener;
    }
    if (options == null) {
        options = this.configuration.defaultDisplayImageOptions;
    }
    if (TextUtils.isEmpty(uri)) {
        this.engine.cancelDisplayTaskFor(imageAware);
        listener.onLoadingStarted(uri, imageAware.getWrappedView());
        if (options.shouldShowImageForEmptyUri()) {
            imageAware.setImageDrawable(options.getImageForEmptyUri(this.configuration.resources));
        } else {
            imageAware.setImageDrawable(null);
        }
        listener.onLoadingComplete(uri, imageAware.getWrappedView(), null);
        return;
    }
    ImageSize targetSize = ImageSizeUtils.defineTargetSizeForView(imageAware, this.configuration.getMaxImageSize());
    String memoryCacheKey = MemoryCacheUtils.generateKey(uri, targetSize);
    this.engine.prepareDisplayTaskFor(imageAware, memoryCacheKey);
    listener.onLoadingStarted(uri, imageAware.getWrappedView());
    Bitmap bmp = (Bitmap) this.configuration.memoryCache.get(memoryCacheKey);
    if (bmp == null || bmp.isRecycled()) {
        if (options.shouldShowImageOnLoading()) {
            imageAware.setImageDrawable(options.getImageOnLoading(this.configuration.resources));
        } else if (options.isResetViewBeforeLoading()) {
            imageAware.setImageDrawable(null);
        }
        LoadAndDisplayImageTask displayTask = new LoadAndDisplayImageTask(this.engine, new ImageLoadingInfo(uri, imageAware, targetSize, memoryCacheKey, options, listener, progressListener, this.engine.getLockForUri(uri)), defineHandler(options));
        if (options.isSyncLoading()) {
            displayTask.run();
            return;
        } else {
            this.engine.submit(displayTask);
            return;
        }
    }
    L.d(LOG_LOAD_IMAGE_FROM_MEMORY_CACHE, memoryCacheKey);
    if (options.shouldPostProcess()) {
        ProcessAndDisplayImageTask displayTask2 = new ProcessAndDisplayImageTask(this.engine, bmp, new ImageLoadingInfo(uri, imageAware, targetSize, memoryCacheKey, options, listener, progressListener, this.engine.getLockForUri(uri)), defineHandler(options));
        if (options.isSyncLoading()) {
            displayTask2.run();
            return;
        } else {
            this.engine.submit(displayTask2);
            return;
        }
    }
    options.getDisplayer().display(bmp, imageAware, LoadedFrom.MEMORY_CACHE);
    listener.onLoadingComplete(uri, imageAware.getWrappedView(), bmp);
}
 
Example 21
Source Project: letv   Source File: ImageLoader.java    License: Apache License 2.0 4 votes vote down vote up
public void displayImage(String uri, ImageView imageView, DisplayImageOptions options, ImageLoadingListener listener) {
    displayImage(uri, imageView, options, listener, null);
}
 
Example 22
Source Project: letv   Source File: ImageLoader.java    License: Apache License 2.0 4 votes vote down vote up
public void displayImage(String uri, ImageView imageView, DisplayImageOptions options, ImageLoadingListener listener, ImageLoadingProgressListener progressListener) {
    displayImage(uri, new ImageViewAware(imageView), options, listener, progressListener);
}
 
Example 23
Source Project: letv   Source File: ImageLoader.java    License: Apache License 2.0 4 votes vote down vote up
public void loadImage(String uri, ImageLoadingListener listener) {
    loadImage(uri, null, null, listener, null);
}
 
Example 24
Source Project: letv   Source File: ImageLoader.java    License: Apache License 2.0 4 votes vote down vote up
public void loadImage(String uri, ImageSize targetImageSize, ImageLoadingListener listener) {
    loadImage(uri, targetImageSize, null, listener, null);
}
 
Example 25
Source Project: letv   Source File: ImageLoader.java    License: Apache License 2.0 4 votes vote down vote up
public void loadImage(String uri, DisplayImageOptions options, ImageLoadingListener listener) {
    loadImage(uri, null, options, listener, null);
}
 
Example 26
Source Project: letv   Source File: ImageLoader.java    License: Apache License 2.0 4 votes vote down vote up
public void loadImage(String uri, ImageSize targetImageSize, DisplayImageOptions options, ImageLoadingListener listener) {
    loadImage(uri, targetImageSize, options, listener, null);
}
 
Example 27
Source Project: letv   Source File: LetvCacheMannager.java    License: Apache License 2.0 4 votes vote down vote up
public void loadPrestrainImage(String imgUrl, ImageLoadingListener listener) {
    InstanceHolder.imageLoader.loadImage(imgUrl, listener);
}
 
Example 28
Source Project: letv   Source File: LetvCacheMannager.java    License: Apache License 2.0 4 votes vote down vote up
public void loadImage(String url, ImageView imageView, ImageLoadingListener loadingListener) {
    if (imageView != null) {
        InstanceHolder.imageLoader.displayImage(url, imageView, loadingListener);
    }
}
 
Example 29
Source Project: letv   Source File: LetvCacheMannager.java    License: Apache License 2.0 4 votes vote down vote up
public void loadImage(String url, ImageView imageView, DisplayImageOptions options, ImageLoadingListener loadingListener) {
    if (imageView != null) {
        InstanceHolder.imageLoader.displayImage(url, imageView, options, loadingListener);
    }
}
 
Example 30
Source Project: MiBandDecompiled   Source File: ImageLoader.java    License: Apache License 2.0 4 votes vote down vote up
public void loadImage(String s, ImageLoadingListener imageloadinglistener)
{
    loadImage(s, null, null, imageloadinglistener, null);
}