ollm opened a new pull request, #1983:
URL: https://github.com/apache/cordova-android/pull/1983

   <!--
   Please make sure the checklist boxes are all checked before submitting the 
PR. The checklist is intended as a quick reference, for complete details please 
see our Contributor Guidelines:
   
   http://cordova.apache.org/contribute/contribute_guidelines.html
   
   Thanks!
   -->
   
   ### Platforms affected
   
   Android
   
   ### Motivation and Context
   <!-- Why is this change required? What problem does it solve? -->
   <!-- If it fixes an open issue, please link to the issue here. -->
   
   Since status bar handling has been added directly to cordova, navigation bar 
control should also be included.
   
   ### Description
   <!-- Describe your changes in detail -->
   
   The changes add 
`window.statusbar.setNavigationBarBackgroundColor('#ffffff00')` to change the 
navigation bar color on older devices or when gesture navigation is disabled 
(3-button navigation).
   
   The navigation buttons color is detected automatically, just like with 
`setBackgroundColor`. `transparentNavigationBar` is also applied automatically 
if the provided color is fully transparent.
   
   Example usage:
   
   
   ``` js
   window.statusbar.setNavigationBarBackgroundColor('#1f2933');
   ```
   
   Android 11:
   
   <img width="534" height="89" alt="Captura desde 2026-07-27 11-59-16" 
src="https://github.com/user-attachments/assets/aa0782bd-7668-499f-bd99-5bafcda7b4e8";
 />
   
   
   Android 17:
   
   <img width="534" height="86" alt="Captura desde 2026-07-27 11-59-06" 
src="https://github.com/user-attachments/assets/42161669-8af7-4899-aadb-d088f0221326";
 />
   
   
   
   
   ``` js
   window.statusbar.setNavigationBarBackgroundColor('#fafafa')
   ```
   
   Android 11:
   
   <img width="534" height="89" alt="Captura desde 2026-07-27 11-59-23" 
src="https://github.com/user-attachments/assets/3cd6bba7-1870-47dd-9096-a5050da0a068";
 />
   
   
   Android 17:
   
   <img width="534" height="85" alt="Captura desde 2026-07-27 11-58-54" 
src="https://github.com/user-attachments/assets/d5388861-3ac1-4563-a0b9-661def31ca67";
 />
   
   
   ### Testing
   <!-- Please describe in detail how you tested your changes. -->
   
   I tested it on the Android 11 and Android 17 emulators.
   
   ### Note
   
    I'm not sure if this is intentional, but I wanted to mention it. If 
`#00000000` is passed to `setBackgroundColor`, the following code treats it as 
fully transparent, so the navigation bar color is not changed to the expected 
one (White icons). For now, I'm using `#01010100` as a workaround.
   
   
https://github.com/apache/cordova-android/blob/ed4e629e9da5721fdaa10dd6da5c85049723686e/framework/src/org/apache/cordova/SystemBarPlugin.java#L189-L193
   
   ### Checklist
   
   - [ ] I've run the tests to see all new and existing tests pass
   - [ ] I added automated test coverage as appropriate for this change
   - [ ] Commit is prefixed with `(platform)` if this change only applies to 
one platform (e.g. `(android)`)
   - [ ] If this Pull Request resolves an issue, I linked to the issue in the 
text above (and used the correct [keyword to close issues using 
keywords](https://help.github.com/articles/closing-issues-using-keywords/))
   - [ ] I've updated the documentation if necessary
   


-- 
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]

Reply via email to