Commit 5f23a12 1 parent a7351b0 commit 5f23a12 Copy full SHA for 5f23a12
File tree 2 files changed +18
-3
lines changed
library/src/main/java/com/bumptech/glide/request
2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -1363,11 +1363,21 @@ public final int getErrorId() {
1363
1363
return errorId ;
1364
1364
}
1365
1365
1366
+ @ SuppressWarnings ("WeakerAccess" )
1367
+ public final boolean hasErrorId () {
1368
+ return isSet (ERROR_ID );
1369
+ }
1370
+
1366
1371
@ SuppressWarnings ("WeakerAccess" )
1367
1372
public final int getPlaceholderId () {
1368
1373
return placeholderId ;
1369
1374
}
1370
1375
1376
+ @ SuppressWarnings ("WeakerAccess" )
1377
+ public final boolean hasPlaceholderId () {
1378
+ return isSet (PLACEHOLDER_ID );
1379
+ }
1380
+
1371
1381
@ SuppressWarnings ("WeakerAccess" )
1372
1382
@ Nullable
1373
1383
public final Drawable getPlaceholderDrawable () {
@@ -1379,6 +1389,11 @@ public final int getFallbackId() {
1379
1389
return fallbackId ;
1380
1390
}
1381
1391
1392
+ @ SuppressWarnings ("WeakerAccess" )
1393
+ public final boolean hasFallbackId () {
1394
+ return isSet (FALLBACK_ID );
1395
+ }
1396
+
1382
1397
@ SuppressWarnings ("WeakerAccess" )
1383
1398
@ Nullable
1384
1399
public final Drawable getFallbackDrawable () {
Original file line number Diff line number Diff line change @@ -387,7 +387,7 @@ public boolean isAnyResourceSet() {
387
387
private Drawable getErrorDrawable () {
388
388
if (errorDrawable == null ) {
389
389
errorDrawable = requestOptions .getErrorPlaceholder ();
390
- if (errorDrawable == null && requestOptions .getErrorId () > 0 ) {
390
+ if (errorDrawable == null && requestOptions .hasErrorId () ) {
391
391
errorDrawable = loadDrawable (requestOptions .getErrorId ());
392
392
}
393
393
}
@@ -398,7 +398,7 @@ private Drawable getErrorDrawable() {
398
398
private Drawable getPlaceholderDrawable () {
399
399
if (placeholderDrawable == null ) {
400
400
placeholderDrawable = requestOptions .getPlaceholderDrawable ();
401
- if (placeholderDrawable == null && requestOptions .getPlaceholderId () > 0 ) {
401
+ if (placeholderDrawable == null && requestOptions .hasPlaceholderId () ) {
402
402
placeholderDrawable = loadDrawable (requestOptions .getPlaceholderId ());
403
403
}
404
404
}
@@ -409,7 +409,7 @@ private Drawable getPlaceholderDrawable() {
409
409
private Drawable getFallbackDrawable () {
410
410
if (fallbackDrawable == null ) {
411
411
fallbackDrawable = requestOptions .getFallbackDrawable ();
412
- if (fallbackDrawable == null && requestOptions .getFallbackId () > 0 ) {
412
+ if (fallbackDrawable == null && requestOptions .hasFallbackId () ) {
413
413
fallbackDrawable = loadDrawable (requestOptions .getFallbackId ());
414
414
}
415
415
}
You can’t perform that action at this time.
0 commit comments