glide
glide copied to clipboard
Fix ResourceID validation check expression
Description
related issue : #5404 I changed three methods which have wrong expression
- getFallbackDrawable()
- getErrorDrawable()
- getPlaceholderDrawable() Resource IDs can be negative, but the functions were treating such IDs as invalid. Therefore, I improved the if statement logic to allow valid resource IDs that have negative values to pass through.
Motivation and Context
According to the referenced documentation, resource IDs can be negative, and while some legacy code assumes -1 to be an invalid resource ID, this is incorrect. The issue #5404 involves a method malfunctioning when using an image with a specific negative value as its resource ID, which was identified as a validation issue related to resourceID. The original code incorrectly assumed any negative value to be an invalid resource ID. However, I have refactored it using the correct validation logic as outlined in the android.content.res package.
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).
View this failed invocation of the CLA check for more information.
For the most up to date status, view the checks section at the bottom of the pull request.