cordova-plugin-statusbar
cordova-plugin-statusbar copied to clipboard
Android: fix 'darkContentStyles' with new 'WindowInsetsControllerCompat'
Added 'WindowInsetsControllerCompat.setAppearanceLightStatusBars' to 'setStatusBarStyle' to fix dark content styles
Platforms affected
- Android
Motivation and Context
In Android 12 the dark-content style wasn't working anymore due to the deprecated View.SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
.
Description
I've added the new WindowInsetsControllerCompat.setAppearanceLightStatusBars
method to make it work again.
Testing
Built the app with Cordova 11.0.0 and Android Studio and tested on Android 12 emulator, Android 11 device and Android 7 device.
Checklist
- [x] I've run the tests to see all new and existing tests pass
- [ ] I added automated test coverage as appropriate for this change
- [x] 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)
- [ ] I've updated the documentation if necessary
Works for me 👍