0x253 commented on a change in pull request #134:
URL:
https://github.com/apache/cordova-plugin-statusbar/pull/134#discussion_r413696510
##########
File path: src/android/StatusBar.java
##########
@@ -206,6 +212,16 @@ public void run() {
return false;
}
+ private float getStatusBarHeight() {
+ float statusBarHeight = 0;
+ int resourceId =
cordova.getActivity().getResources().getIdentifier("status_bar_height",
"dimen", "android");
+ if (resourceId > 0) {
+ float scaleRatio =
cordova.getActivity().getResources().getDisplayMetrics().density;
+ statusBarHeight =
cordova.getActivity().getResources().getDimension(resourceId) / scaleRatio;
+ }
+ return statusBarHeight;
Review comment:
Perhaps
https://developer.mozilla.org/en-US/docs/Web/API/Window/orientationchange_event
could help to detect the screen orientation change and recompute the statusbar
height?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]