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 2020/03/21 12:59:57 UTC
[cordova-plugin-statusbar] branch master updated: deprecate
blacktranslucent, blackopaque,
styleBlackTranslucent and styleBlackOpaque (#173)
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 2928339 deprecate blacktranslucent, blackopaque, styleBlackTranslucent and styleBlackOpaque (#173)
2928339 is described below
commit 29283396113ab1c46d36b61f397f5cdde32686f7
Author: jcesarmobile <jc...@gmail.com>
AuthorDate: Sat Mar 21 13:59:48 2020 +0100
deprecate blacktranslucent, blackopaque, styleBlackTranslucent and styleBlackOpaque (#173)
---
README.md | 8 +++++---
src/android/StatusBar.java | 6 +++++-
src/ios/CDVStatusBar.m | 6 +++++-
www/statusbar.js | 4 ++--
4 files changed, 17 insertions(+), 7 deletions(-)
diff --git a/README.md b/README.md
index 4b6fc31..1d0ce9c 100644
--- a/README.md
+++ b/README.md
@@ -34,9 +34,7 @@ description: Control the device status bar.
This installation method requires cordova 5.0+
cordova plugin add cordova-plugin-statusbar
-Older versions of cordova can still install via the __deprecated__ id
- cordova plugin add org.apache.cordova.statusbar
It is also possible to install via repo url directly ( unstable )
cordova plugin add https://github.com/apache/cordova-plugin-statusbar.git
@@ -59,7 +57,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, blackopaque.
+- __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.
<preference name="StatusBarStyle" value="lightcontent" />
@@ -197,6 +195,8 @@ Supported Platforms
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();
@@ -212,6 +212,8 @@ Supported Platforms
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();
diff --git a/src/android/StatusBar.java b/src/android/StatusBar.java
index 714c30e..5159ada 100644
--- a/src/android/StatusBar.java
+++ b/src/android/StatusBar.java
@@ -63,7 +63,11 @@ public class StatusBar extends CordovaPlugin {
setStatusBarBackgroundColor(preferences.getString("StatusBarBackgroundColor", "#000000"));
// Read 'StatusBarStyle' from config.xml, default is 'lightcontent'.
- setStatusBarStyle(preferences.getString("StatusBarStyle", "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);
}
});
}
diff --git a/src/ios/CDVStatusBar.m b/src/ios/CDVStatusBar.m
index 1a42639..058bbef 100644
--- a/src/ios/CDVStatusBar.m
+++ b/src/ios/CDVStatusBar.m
@@ -137,7 +137,11 @@ static const void *kStatusBarStyle = &kStatusBarStyle;
setting = @"StatusBarStyle";
if ([self settingForKey:setting]) {
- [self setStatusBarStyle:[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];
}
setting = @"StatusBarDefaultScrollToTop";
diff --git a/www/statusbar.js b/www/statusbar.js
index d9d0ea5..d6ab16b 100644
--- a/www/statusbar.js
+++ b/www/statusbar.js
@@ -59,12 +59,12 @@ var StatusBar = {
},
styleBlackTranslucent: function () {
- // #88000000 ? Apple says to use lightContent instead
+ console.warn('styleBlackTranslucent is deprecated and will be removed in next major release, use styleLightContent');
exec(null, null, "StatusBar", "styleBlackTranslucent", []);
},
styleBlackOpaque: function () {
- // #FF000000 ? Apple says to use lightContent instead
+ console.warn('styleBlackOpaque is deprecated and will be removed in next major release, use styleLightContent');
exec(null, null, "StatusBar", "styleBlackOpaque", []);
},
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org