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; }
/** * Adds load image task to execution pool. Image will be returned with * {@link ImageLoadingListener#onLoadingComplete(String, android.view.View, android.graphics.Bitmap)} callback}. * <br /> * <b>NOTE:</b> {@link #init(ImageLoaderConfiguration)} method must be called before this method call * * @param uri Image URI (i.e. "http://site.com/image.png", "file:///mnt/sdcard/image.png") * @param targetImageSize Minimal size for {@link Bitmap} which will be returned in * {@linkplain ImageLoadingListener#onLoadingComplete(String, android.view.View, * android.graphics.Bitmap)} callback}. Downloaded image will be decoded * and scaled to {@link Bitmap} of the size which is <b>equal or larger</b> (usually a bit * larger) than incoming targetImageSize. * @param options {@linkplain com.nostra13.universalimageloader.core.DisplayImageOptions Options} for image * decoding and displaying. If <b>null</b> - default display image options * {@linkplain ImageLoaderConfiguration.Builder#defaultDisplayImageOptions(DisplayImageOptions) * from configuration} will be used.<br /> * @param listener {@linkplain ImageLoadingListener Listener} for image loading process. Listener fires * events on UI thread. * @param progressListener {@linkplain com.nostra13.universalimageloader.core.assist.ImageLoadingProgressListener * Listener} for image loading progress. Listener fires events on UI thread. * @throws IllegalStateException if {@link #init(ImageLoaderConfiguration)} method wasn't called before */ public void loadImage(String uri, ImageSize targetImageSize, DisplayImageOptions options, ImageLoadingListener listener, ImageLoadingProgressListener progressListener) { checkConfiguration(); if (targetImageSize == null) { targetImageSize = configuration.getMaxImageSize(); } if (options == null) { options = configuration.defaultDisplayImageOptions; } ImageNonViewAware imageAware = new ImageNonViewAware(uri, targetImageSize, ViewScaleType.CROP); displayImage(uri, imageAware, options, listener, progressListener); }
/** * Adds display image task to execution pool. Image will be set to ImageView when it's turn.<br /> * <b>NOTE:</b> {@link #init(ImageLoaderConfiguration)} method must be called before this method call * * @param uri Image URI (i.e. "http://site.com/image.png", "file:///mnt/sdcard/image.png") * @param imageView {@link ImageView} which should display image * @param options {@linkplain com.nostra13.universalimageloader.core.DisplayImageOptions Options} for image * decoding and displaying. If <b>null</b> - default display image options * {@linkplain ImageLoaderConfiguration.Builder#defaultDisplayImageOptions(DisplayImageOptions) * from configuration} will be used. * @param listener {@linkplain ImageLoadingListener Listener} for image loading process. Listener fires * events on UI thread. * @param progressListener {@linkplain com.nostra13.universalimageloader.core.assist.ImageLoadingProgressListener * Listener} for image loading progress. Listener fires events on UI thread. * @throws IllegalStateException if {@link #init(ImageLoaderConfiguration)} method wasn't called before * @throws IllegalArgumentException if passed <b>imageView</b> is null */ public void displayImage(String uri, ImageView imageView, DisplayImageOptions options, ImageLoadingListener listener, ImageLoadingProgressListener progressListener) { displayImage(uri, new ImageViewAware(imageView), options, listener, progressListener); }