You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by jc...@apache.org on 2022/10/19 21:39:50 UTC

[cordova-plugin-statusbar] branch drop-old created (now 9eee551)

This is an automated email from the ASF dual-hosted git repository.

jcesarmobile pushed a change to branch drop-old
in repository https://gitbox.apache.org/repos/asf/cordova-plugin-statusbar.git


      at 9eee551  refactor(ios)!: Drop support of iOS 10 and older

This branch includes the following new commits:

     new 9eee551  refactor(ios)!: Drop support of iOS 10 and older

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



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


[cordova-plugin-statusbar] 01/01: refactor(ios)!: Drop support of iOS 10 and older

Posted by jc...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jcesarmobile pushed a commit to branch drop-old
in repository https://gitbox.apache.org/repos/asf/cordova-plugin-statusbar.git

commit 9eee55194c9179bfe913ad26bcaaa68a10c798d2
Author: jcesarmobile <jc...@gmail.com>
AuthorDate: Wed Oct 19 23:38:22 2022 +0200

    refactor(ios)!: Drop support of iOS 10 and older
---
 package.json           |  3 ++-
 plugin.xml             |  1 +
 src/ios/CDVStatusBar.m | 21 ++++++---------------
 3 files changed, 9 insertions(+), 16 deletions(-)

diff --git a/package.json b/package.json
index 71b3cbf..dba5abe 100644
--- a/package.json
+++ b/package.json
@@ -30,7 +30,8 @@
       },
       "4.0.0": {
         "cordova-android": ">=10.0.0",
-        "cordova": ">=3.0.0"
+        "cordova": ">=3.0.0",
+        "cordova-ios": ">=6.0.0"
       },
       "5.0.0": {
         "cordova": ">100"
diff --git a/plugin.xml b/plugin.xml
index a57dfdd..923fa2d 100644
--- a/plugin.xml
+++ b/plugin.xml
@@ -30,6 +30,7 @@
     <engines>
             <engine name="cordova" version=">=3.0.0" />
             <engine name="cordova-android" version=">=10.0.0" />
+            <engine name="cordova-ios" version=">=6.0.0" />
     </engines>
 
     <js-module src="www/statusbar.js" name="statusbar">
diff --git a/src/ios/CDVStatusBar.m b/src/ios/CDVStatusBar.m
index 12735f7..c825c1a 100644
--- a/src/ios/CDVStatusBar.m
+++ b/src/ios/CDVStatusBar.m
@@ -428,8 +428,6 @@ static const void *kStatusBarStyle = &kStatusBarStyle;
 
 -(void)resizeWebView
 {
-    BOOL isIOS11 = (IsAtLeastiOSVersion(@"11.0"));
-
     CGRect bounds = [self.viewController.view.window bounds];
     if (CGRectEqualToRect(bounds, CGRectZero)) {
         bounds = [[UIScreen mainScreen] bounds];
@@ -446,19 +444,12 @@ static const void *kStatusBarStyle = &kStatusBarStyle;
     if (!self.statusBarOverlaysWebView) {
         frame.origin.y = height;
     } else {
-        frame.origin.y = height >= 20 ? height - 20 : 0;
-        if (isIOS11) {
-#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000
-            if (@available(iOS 11.0, *)) {
-                float safeAreaTop = self.webView.safeAreaInsets.top;
-                if (height >= safeAreaTop && safeAreaTop >0) {
-                    // Sometimes when in-call/recording/hotspot larger status bar is present, the safeAreaTop is 40 but we want frame.origin.y to be 20
-                    frame.origin.y = safeAreaTop == 40 ? 20 : height - safeAreaTop;
-                } else {
-                    frame.origin.y = 0;
-                }
-            }
-#endif
+        float safeAreaTop = self.webView.safeAreaInsets.top;
+        if (height >= safeAreaTop && safeAreaTop >0) {
+            // Sometimes when in-call/recording/hotspot larger status bar is present, the safeAreaTop is 40 but we want frame.origin.y to be 20
+            frame.origin.y = safeAreaTop == 40 ? 20 : height - safeAreaTop;
+        } else {
+            frame.origin.y = 0;
         }
     }
     frame.size.height -= frame.origin.y;


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