apache / cordova-plugin-statusbar

Apache Cordova Status Bar Plugin
https://cordova.apache.org/
Apache License 2.0
618 stars 480 forks source link

fix(android)!: styleDefault not working on new devices #238

Closed jcesarmobile closed 1 year ago

jcesarmobile commented 1 year ago

Platforms affected

android

Motivation and Context

styleDefault is not working on some Android 12/13 devices, this PR makes it work again.

Description

The PR uses WindowInsetsControllerCompat.setAppearanceLightStatusBars instead of the deprecated SYSTEM_UI_FLAG_LIGHT_STATUS_BAR. Makes styleDefault work on new devices.

It's a breaking change because it requires androidx.core, which is only available on cordova-android > 9. At the moment the plugin doesn't have any cordova-android version requirement, so requiring cordova-android > 9 is breaking.

A separate PR would be sent to set the engines if this PR gets accepted.

closes https://github.com/apache/cordova-plugin-statusbar/issues/236

closes https://github.com/apache/cordova-plugin-statusbar/pull/235, which is a similar PR but uses deprecated methods.

Testing

Tested on real devices and emulators

Checklist