cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [cordova-plugin-statusbar] 0x253 commented on a change in pull request #134: feat: get statusbar height (top-inset)
Date Thu, 23 Apr 2020 10:22:44 GMT

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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org


Mime
View raw message