@@ -204,6 +204,34 @@ public void displayImage(String uri, ImageAware imageAware, DisplayImageOptions
204
204
* @throws IllegalArgumentException if passed <b>imageAware</b> is null
205
205
*/
206
206
public void displayImage (String uri , ImageAware imageAware , DisplayImageOptions options ,
207
+ ImageLoadingListener listener , ImageLoadingProgressListener progressListener ) {
208
+ displayImage (uri ,imageAware ,options ,null ,listener ,progressListener );
209
+ }
210
+
211
+ /**
212
+ * Adds display image task to execution pool. Image will be set to ImageAware when it's turn.<br />
213
+ * <b>NOTE:</b> {@link #init(ImageLoaderConfiguration)} method must be called before this method call
214
+ *
215
+ * @param uri Image URI (i.e. "http://site.com/image.png", "file:///mnt/sdcard/image.png")
216
+ * @param imageAware {@linkplain com.nostra13.universalimageloader.core.imageaware.ImageAware Image aware view}
217
+ * which should display image
218
+ * @param options {@linkplain com.nostra13.universalimageloader.core.DisplayImageOptions Options} for image
219
+ * decoding and displaying. If <b>null</b> - default display image options
220
+ * {@linkplain ImageLoaderConfiguration.Builder#defaultDisplayImageOptions(DisplayImageOptions)
221
+ * from configuration} will be used.
222
+ * @param targetImageSize {@linkplain ImageSize} Image target size. If <b>null</b> - size will depend on the view
223
+ * @param listener {@linkplain ImageLoadingListener Listener} for image loading process. Listener fires
224
+ * events on UI thread if this method is called on UI thread.
225
+ * @param progressListener {@linkplain com.nostra13.universalimageloader.core.listener.ImageLoadingProgressListener
226
+ * Listener} for image loading progress. Listener fires events on UI thread if this method
227
+ * is called on UI thread. Caching on disk should be enabled in
228
+ * {@linkplain com.nostra13.universalimageloader.core.DisplayImageOptions options} to make
229
+ * this listener work.
230
+ * @throws IllegalStateException if {@link #init(ImageLoaderConfiguration)} method wasn't called before
231
+ * @throws IllegalArgumentException if passed <b>imageAware</b> is null
232
+ */
233
+ public void displayImage (String uri , ImageAware imageAware , DisplayImageOptions options ,
234
+ ImageSize targetImageSize ,
207
235
ImageLoadingListener listener , ImageLoadingProgressListener progressListener ) {
208
236
checkConfiguration ();
209
237
if (imageAware == null ) {
@@ -228,7 +256,12 @@ public void displayImage(String uri, ImageAware imageAware, DisplayImageOptions
228
256
return ;
229
257
}
230
258
231
- ImageSize targetSize = ImageSizeUtils .defineTargetSizeForView (imageAware , configuration .getMaxImageSize ());
259
+ ImageSize targetSize ;
260
+ if (targetImageSize != null ) {
261
+ targetSize = targetImageSize ;
262
+ }else {
263
+ targetSize = ImageSizeUtils .defineTargetSizeForView (imageAware , configuration .getMaxImageSize ());
264
+ }
232
265
String memoryCacheKey = MemoryCacheUtils .generateKey (uri , targetSize );
233
266
engine .prepareDisplayTaskFor (imageAware , memoryCacheKey );
234
267
@@ -286,6 +319,20 @@ public void displayImage(String uri, ImageView imageView) {
286
319
displayImage (uri , new ImageViewAware (imageView ), null , null , null );
287
320
}
288
321
322
+ /**
323
+ * Adds display image task to execution pool. Image will be set to ImageView when it's turn. <br/>
324
+ * Default {@linkplain DisplayImageOptions display image options} from {@linkplain ImageLoaderConfiguration
325
+ * configuration} will be used.<br />
326
+ * <b>NOTE:</b> {@link #init(ImageLoaderConfiguration)} method must be called before this method call
327
+ *
328
+ * @param uri Image URI (i.e. "http://site.com/image.png", "file:///mnt/sdcard/image.png")
329
+ * @param imageView {@link ImageView} which should display image
330
+ * @throws IllegalStateException if {@link #init(ImageLoaderConfiguration)} method wasn't called before
331
+ * @throws IllegalArgumentException if passed <b>imageView</b> is null
332
+ */
333
+ public void displayImage (String uri , ImageView imageView , ImageSize targetImageSize ) {
334
+ displayImage (uri , new ImageViewAware (imageView ), null , targetImageSize , null , null );
335
+ }
289
336
/**
290
337
* Adds display image task to execution pool. Image will be set to ImageView when it's turn.<br />
291
338
* <b>NOTE:</b> {@link #init(ImageLoaderConfiguration)} method must be called before this method call
0 commit comments