apache / cordova-plugin-statusbar

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

refactor(android)!: setStatusBarBackgroundColor #250

Closed erisu closed 1 year ago

erisu commented 1 year ago

Platforms affected

Android

Motivation and Context

refactor setStatusBarBackgroundColor

Description

setStatusBarBackgroundColor use to use reflection so that the project didn't need to be compile with SDK level 21 or higher.

Per plugin's defined cordova-android requirement, in plugin.xml and package.json, the minimum supported SDK level is 22. Reflection should not be required anymore.

Also, we do not need to type in the hex values anymore on the following lines as SDK 22 is minimum and the WindowManager.LayoutParams is available.

window.clearFlags(0x04000000); // SDK 19: WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
 window.addFlags(0x80000000); // SDK 21: WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);

Testing

Build with AS

Checklist