Skip to content

Commit ddf34ed

Browse files
committed
Issue nostra13#252 - Introduced DisplayImageOptions.cacheInMemory(boolean), .cacheOnDisc(boolean), resetViewBeforeLoading(boolean)
Deprecated appropriate methods without boolean param
1 parent ce48178 commit ddf34ed

File tree

1 file changed

+35
-5
lines changed

1 file changed

+35
-5
lines changed

library/src/com/nostra13/universalimageloader/core/DisplayImageOptions.java

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
* <li>image scale type</li>
4040
* <li>decoding options (including bitmap decoding configuration)</li>
4141
* <li>delay before loading of image</li>
42-
* <li>auxiliary object which will be passed to {@link ImageDownloader#getStream(java.net.URI, Object) ImageDownloader}</li>
42+
* <li>auxiliary object which will be passed to {@link ImageDownloader#getStream(String, Object) ImageDownloader}</li>
4343
* <li>pre-processor for image Bitmap (before caching in memory)</li>
4444
* <li>post-processor for image Bitmap (after caching in memory, before displaying)</li>
4545
* <li>how decoded {@link Bitmap} will be displayed</li>
@@ -229,24 +229,54 @@ public Builder showImageOnFail(int imageRes) {
229229
return this;
230230
}
231231

232-
/** {@link android.widget.ImageView ImageView} will be reset (set <b>null</b>) before image loading start */
232+
/**
233+
* {@link android.widget.ImageView ImageView} will be reset (set <b>null</b>) before image loading start
234+
*
235+
* @deprecated Use {@link #resetViewBeforeLoading(boolean) resetViewBeforeLoading(true)} instead
236+
*/
233237
public Builder resetViewBeforeLoading() {
234238
resetViewBeforeLoading = true;
235239
return this;
236240
}
237241

238-
/** Loaded image will be cached in memory */
242+
/** Sets whether {@link android.widget.ImageView ImageView} will be reset (set <b>null</b>) before image loading start */
243+
public Builder resetViewBeforeLoading(boolean resetViewBeforeLoading) {
244+
this.resetViewBeforeLoading = resetViewBeforeLoading;
245+
return this;
246+
}
247+
248+
/**
249+
* Loaded image will be cached in memory
250+
*
251+
* @deprecated Use {@link #cacheInMemory(boolean) cacheInMemory(true)} instead
252+
*/
239253
public Builder cacheInMemory() {
240254
cacheInMemory = true;
241255
return this;
242256
}
243257

244-
/** Loaded image will be cached on disc */
258+
/** Sets whether loaded image will be cached in memory */
259+
public Builder cacheInMemory(boolean cacheInMemory) {
260+
this.cacheInMemory = cacheInMemory;
261+
return this;
262+
}
263+
264+
/**
265+
* Loaded image will be cached on disc
266+
*
267+
* @deprecated Use {@link #cacheOnDisc(boolean) cacheOnDisc(true)} instead
268+
*/
245269
public Builder cacheOnDisc() {
246270
cacheOnDisc = true;
247271
return this;
248272
}
249273

274+
/** Sets whether loaded image will be cached on disc */
275+
public Builder cacheOnDisc(boolean cacheOnDisc) {
276+
this.cacheOnDisc = cacheOnDisc;
277+
return this;
278+
}
279+
250280
/**
251281
* Sets {@linkplain ImageScaleType scale type} for decoding image. This parameter is used while define scale
252282
* size for decoding image to Bitmap. Default value - {@link ImageScaleType#IN_SAMPLE_POWER_OF_2}
@@ -281,7 +311,7 @@ public Builder delayBeforeLoading(int delayInMillis) {
281311
return this;
282312
}
283313

284-
/** Sets auxiliary object which will be passed to {@link ImageDownloader#getStream(java.net.URI, Object)} */
314+
/** Sets auxiliary object which will be passed to {@link ImageDownloader#getStream(String, Object)} */
285315
public Builder extraForDownloader(Object extra) {
286316
this.extraForDownloader = extra;
287317
return this;

0 commit comments

Comments
 (0)