gabriel2mm opened a new issue, #1938: URL: https://github.com/apache/cordova-android/issues/1938
# Bug Report ## Problem ### What is expected to happen? When passing a valid color such as #FFFFFFFF to the status bar color configuration, the color should be parsed correctly and applied as white. ### What does actually happen? #FFFFFFFF is being treated as an invalid color. The issue appears to come from the following implementation: <img width="1179" height="623" alt="Image" src="https://github.com/user-attachments/assets/79466111-bef6-4f9d-8705-8facd4739400" /> `static final int INVALID_COLOR = -1;` Because Android's Color.parseColor("#FFFFFFFF") returns -1 (0xFFFFFFFF as signed int), a valid white color collides with the sentinel value used for invalid colors. As a result, fully opaque white cannot be used. **This becomes especially noticeable when a custom color is applied first and then changed back to white, since the white color is ignored.** example: <img width="1761" height="1030" alt="Image" src="https://github.com/user-attachments/assets/8073894c-8c6f-4e0a-978f-c77f6282b8ca" /> I would like to propose a small fix to make this case work correctly. ## Information <!-- Include all relevant information that might help understand and reproduce the problem --> Android color integers are signed 32-bit integers. Color.parseColor("#FFFFFFFF") correctly returns -1, which is also equal to Color.WHITE. The issue is not in Color.parseColor(), but in using -1 as INVALID_COLOR. ### Command or Code window.statusbar.setBackgroundColor('#FFFFFFFF'); ### Environment, Platform, Device Platform: Android Device: Any I tested this on both a physical Android 16 device and an emulator. ### Version information cordova 13.0.0 cordova-android 15.0.0 ionic 4 ## Checklist <!-- Please check the boxes by putting an x in the [ ] like so: [x] --> - [x] I searched for existing GitHub issues - [x] I updated all Cordova tooling to most recent version - [x] I included all the necessary information above -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
