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

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


The following commit(s) were added to refs/heads/master by this push:
     new fbe33eb  refactor!: remove deprecated methods (#229)
fbe33eb is described below

commit fbe33eb327d86b5be4c72e535a8b5c4dcd2b1d2e
Author: jcesarmobile <jcesarmob...@gmail.com>
AuthorDate: Mon Sep 5 23:20:52 2022 +0200

    refactor!: remove deprecated methods (#229)
---
 README.md                     | 39 +--------------------------------------
 src/android/StatusBar.java    | 27 +--------------------------
 src/browser/StatusBarProxy.js |  2 --
 src/ios/CDVStatusBar.h        |  2 --
 src/ios/CDVStatusBar.m        | 19 +------------------
 src/windows/StatusBarProxy.js | 10 ----------
 tests/tests.js                | 19 -------------------
 types/index.d.ts              | 10 ----------
 www/statusbar.js              | 10 ----------
 9 files changed, 3 insertions(+), 135 deletions(-)

diff --git a/README.md b/README.md
index e704624..fc1b057 100644
--- a/README.md
+++ b/README.md
@@ -55,7 +55,7 @@ Preferences
 
         <preference name="StatusBarBackgroundColor" value="#000000" />
 
-- __StatusBarStyle__ (status bar style, defaults to lightcontent). Set the 
status bar style (e.g. text color). Available options: `default`, 
`lightcontent`. `blacktranslucent` and `blackopaque` are also available, but 
__deprecated__, will be removed in next major release, use `lightcontent` 
instead.
+- __StatusBarStyle__ (status bar style, defaults to lightcontent). Set the 
status bar style (e.g. text color). Available options: `default`, 
`lightcontent`.
 
         <preference name="StatusBarStyle" value="lightcontent" />
 
@@ -118,8 +118,6 @@ Although in the global scope, it is not available until 
after the `deviceready`
 - StatusBar.overlaysWebView
 - StatusBar.styleDefault
 - StatusBar.styleLightContent
-- StatusBar.styleBlackTranslucent
-- StatusBar.styleBlackOpaque
 - StatusBar.backgroundColorByName
 - StatusBar.backgroundColorByHexString
 - StatusBar.hide
@@ -190,41 +188,6 @@ Supported Platforms
 - Android 6+
 - Windows
 
-StatusBar.styleBlackTranslucent
-=================
-
-Note: `styleBlackTranslucent` is __deprecated__ and will be removed in next 
major release, use `styleLightContent` instead.
-
-Use the blackTranslucent statusbar (light text, for dark backgrounds).
-
-    StatusBar.styleBlackTranslucent();
-
-
-Supported Platforms
--------------------
-
-- iOS
-- Android 6+
-- Windows
-
-StatusBar.styleBlackOpaque
-=================
-
-Note: `styleBlackOpaque` is __deprecated__ and will be removed in next major 
release, use `styleLightContent` instead.
-
-Use the blackOpaque statusbar (light text, for dark backgrounds).
-
-    StatusBar.styleBlackOpaque();
-
-
-Supported Platforms
--------------------
-
-- iOS
-- Android 6+
-- Windows
-
-
 StatusBar.backgroundColorByName
 =================
 
diff --git a/src/android/StatusBar.java b/src/android/StatusBar.java
index 593e379..979744c 100644
--- a/src/android/StatusBar.java
+++ b/src/android/StatusBar.java
@@ -70,9 +70,6 @@ public class StatusBar extends CordovaPlugin {
 
                 // Read 'StatusBarStyle' from config.xml, default is 
'lightcontent'.
                 String styleSetting = preferences.getString("StatusBarStyle", 
"lightcontent");
-                if (styleSetting.equalsIgnoreCase("blacktranslucent") || 
styleSetting.equalsIgnoreCase("blackopaque")) {
-                    LOG.w(TAG, styleSetting +" is deprecated and will be 
removed in next major release, use lightcontent");
-                }
                 setStatusBarStyle(styleSetting);
             }
         });
@@ -193,26 +190,6 @@ public class StatusBar extends CordovaPlugin {
             return true;
         }
 
-        if ("styleBlackTranslucent".equals(action)) {
-            this.cordova.getActivity().runOnUiThread(new Runnable() {
-                @Override
-                public void run() {
-                    setStatusBarStyle("blacktranslucent");
-                }
-            });
-            return true;
-        }
-
-        if ("styleBlackOpaque".equals(action)) {
-            this.cordova.getActivity().runOnUiThread(new Runnable() {
-                @Override
-                public void run() {
-                    setStatusBarStyle("blackopaque");
-                }
-            });
-            return true;
-        }
-
         return false;
     }
 
@@ -266,8 +243,6 @@ public class StatusBar extends CordovaPlugin {
 
                 String[] lightContentStyles = {
                     "lightcontent",
-                    "blacktranslucent",
-                    "blackopaque",
                 };
 
                 if 
(Arrays.asList(darkContentStyles).contains(style.toLowerCase())) {
@@ -280,7 +255,7 @@ public class StatusBar extends CordovaPlugin {
                     return;
                 }
 
-                LOG.e(TAG, "Invalid style, must be either 'default', 
'lightcontent' or the deprecated 'blacktranslucent' and 'blackopaque'");
+                LOG.e(TAG, "Invalid style, must be either 'default' or 
'lightcontent'");
             }
         }
     }
diff --git a/src/browser/StatusBarProxy.js b/src/browser/StatusBarProxy.js
index 173d9d5..32a4f80 100644
--- a/src/browser/StatusBarProxy.js
+++ b/src/browser/StatusBarProxy.js
@@ -33,10 +33,8 @@ function notSupported (win, fail) {
 
 module.exports = {
     isVisible: false,
-    styleBlackTranslucent: notSupported,
     styleDefault: notSupported,
     styleLightContent: notSupported,
-    styleBlackOpaque: notSupported,
     overlaysWebView: notSupported,
     backgroundColorByName: notSupported,
     backgroundColorByHexString: notSupported,
diff --git a/src/ios/CDVStatusBar.h b/src/ios/CDVStatusBar.h
index 0be08cc..4c23b10 100644
--- a/src/ios/CDVStatusBar.h
+++ b/src/ios/CDVStatusBar.h
@@ -36,8 +36,6 @@
 
 - (void) styleDefault:(CDVInvokedUrlCommand*)command;
 - (void) styleLightContent:(CDVInvokedUrlCommand*)command;
-- (void) styleBlackTranslucent:(CDVInvokedUrlCommand*)command;
-- (void) styleBlackOpaque:(CDVInvokedUrlCommand*)command;
 
 - (void) backgroundColorByName:(CDVInvokedUrlCommand*)command;
 - (void) backgroundColorByHexString:(CDVInvokedUrlCommand*)command;
diff --git a/src/ios/CDVStatusBar.m b/src/ios/CDVStatusBar.m
index 058bbef..7dd4aa0 100644
--- a/src/ios/CDVStatusBar.m
+++ b/src/ios/CDVStatusBar.m
@@ -138,9 +138,6 @@ static const void *kStatusBarStyle = &kStatusBarStyle;
     setting  = @"StatusBarStyle";
     if ([self settingForKey:setting]) {
         NSString * styleSetting = [self settingForKey:setting];
-        if ([styleSetting isEqualToString:@"blacktranslucent"] || 
[styleSetting isEqualToString:@"blackopaque"]) {
-            NSLog(@"%@ is deprecated and will be removed in next major 
release, use lightcontent", styleSetting);
-        }
         [self setStatusBarStyle:styleSetting];
     }
 
@@ -282,17 +279,13 @@ static const void *kStatusBarStyle = &kStatusBarStyle;
 
 - (void) setStatusBarStyle:(NSString*)statusBarStyle
 {
-    // default, lightContent, blackTranslucent, blackOpaque
+    // default, lightContent
     NSString* lcStatusBarStyle = [statusBarStyle lowercaseString];
 
     if ([lcStatusBarStyle isEqualToString:@"default"]) {
         [self styleDefault:nil];
     } else if ([lcStatusBarStyle isEqualToString:@"lightcontent"]) {
         [self styleLightContent:nil];
-    } else if ([lcStatusBarStyle isEqualToString:@"blacktranslucent"]) {
-        [self styleBlackTranslucent:nil];
-    } else if ([lcStatusBarStyle isEqualToString:@"blackopaque"]) {
-        [self styleBlackOpaque:nil];
     }
 }
 
@@ -311,16 +304,6 @@ static const void *kStatusBarStyle = &kStatusBarStyle;
     [self setStyleForStatusBar:UIStatusBarStyleLightContent];
 }
 
-- (void) styleBlackTranslucent:(CDVInvokedUrlCommand*)command
-{
-    [self setStyleForStatusBar:UIStatusBarStyleLightContent];
-}
-
-- (void) styleBlackOpaque:(CDVInvokedUrlCommand*)command
-{
-    [self setStyleForStatusBar:UIStatusBarStyleLightContent];
-}
-
 - (void) backgroundColorByName:(CDVInvokedUrlCommand*)command
 {
     id value = [command argumentAtIndex:0];
diff --git a/src/windows/StatusBarProxy.js b/src/windows/StatusBarProxy.js
index 57e7fb0..07c5a31 100644
--- a/src/windows/StatusBarProxy.js
+++ b/src/windows/StatusBarProxy.js
@@ -80,16 +80,6 @@ module.exports = {
         }
     },
 
-    styleBlackTranslucent: function () {
-        // #88000000 ? Apple says to use lightContent instead
-        return module.exports.styleLightContent();
-    },
-
-    styleBlackOpaque: function () {
-        // #FF000000 ? Apple says to use lightContent instead
-        return module.exports.styleLightContent();
-    },
-
     backgroundColorByHexString: function (win, fail, args) {
         var rgb = hexToRgb(args[0]);
         if (isSupported()) {
diff --git a/tests/tests.js b/tests/tests.js
index dee2eb1..1f907f9 100644
--- a/tests/tests.js
+++ b/tests/tests.js
@@ -44,18 +44,12 @@ exports.defineAutoTests = function () {
         });
 
         it('statusbar.spec.4 should have set style methods', function () {
-            expect(window.StatusBar.styleBlackTranslucent).toBeDefined();
-            expect(typeof 
window.StatusBar.styleBlackTranslucent).toBe('function');
-
             expect(window.StatusBar.styleDefault).toBeDefined();
             expect(typeof window.StatusBar.styleDefault).toBe('function');
 
             expect(window.StatusBar.styleLightContent).toBeDefined();
             expect(typeof window.StatusBar.styleLightContent).toBe('function');
 
-            expect(window.StatusBar.styleBlackOpaque).toBeDefined();
-            expect(typeof window.StatusBar.styleBlackOpaque).toBe('function');
-
             expect(window.StatusBar.overlaysWebView).toBeDefined();
             expect(typeof window.StatusBar.overlaysWebView).toBe('function');
         });
@@ -85,11 +79,6 @@ exports.defineManualTests = function (contentEl, 
createActionButton) {
         StatusBar.backgroundColorByName('red');
     }
 
-    function doColor2 () {
-        log('set style=translucent black');
-        StatusBar.styleBlackTranslucent();
-    }
-
     function doColor3 () {
         log('set style=default');
         StatusBar.styleDefault();
@@ -153,14 +142,6 @@ exports.defineManualTests = function (contentEl, 
createActionButton) {
         'action-color1'
     );
 
-    createActionButton(
-        'Style=translucent black',
-        function () {
-            doColor2();
-        },
-        'action-color2'
-    );
-
     createActionButton(
         'Style=default',
         function () {
diff --git a/types/index.d.ts b/types/index.d.ts
index 608f989..73cd33b 100644
--- a/types/index.d.ts
+++ b/types/index.d.ts
@@ -34,16 +34,6 @@ interface StatusBar {
     */
     styleLightContent(): void;
 
-    /**
-    * Use the blackTranslucent statusbar (light text, for dark backgrounds).
-    */
-    styleBlackTranslucent(): void;
-
-    /**
-    * Use the blackOpaque statusbar (light text, for dark backgrounds).
-    */
-    styleBlackOpaque(): void;
-
     /**
     * On iOS 7, when you set StatusBar.statusBarOverlaysWebView to false,
     * you can set the background color of the statusbar by color name.
diff --git a/www/statusbar.js b/www/statusbar.js
index 76c3263..c191e14 100644
--- a/www/statusbar.js
+++ b/www/statusbar.js
@@ -57,16 +57,6 @@ var StatusBar = {
         exec(null, null, 'StatusBar', 'styleLightContent', []);
     },
 
-    styleBlackTranslucent: function () {
-        console.warn('styleBlackTranslucent is deprecated and will be removed 
in next major release, use styleLightContent');
-        exec(null, null, 'StatusBar', 'styleBlackTranslucent', []);
-    },
-
-    styleBlackOpaque: function () {
-        console.warn('styleBlackOpaque is deprecated and will be removed in 
next major release, use styleLightContent');
-        exec(null, null, 'StatusBar', 'styleBlackOpaque', []);
-    },
-
     backgroundColorByName: function (colorname) {
         return StatusBar.backgroundColorByHexString(namedColors[colorname]);
     },


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

Reply via email to