deprecate blacktranslucent, blackopaque, styleBlackTranslucent and styleBlackOpaque (#173)

This commit is contained in:
jcesarmobile 2020-03-21 13:59:48 +01:00 committed by GitHub
parent 24d5f278d0
commit 2928339611
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 7 deletions

View File

@ -34,9 +34,7 @@ description: Control the device status bar.
This installation method requires cordova 5.0+ This installation method requires cordova 5.0+
cordova plugin add cordova-plugin-statusbar 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 ) It is also possible to install via repo url directly ( unstable )
cordova plugin add https://github.com/apache/cordova-plugin-statusbar.git cordova plugin add https://github.com/apache/cordova-plugin-statusbar.git
@ -59,7 +57,7 @@ Preferences
<preference name="StatusBarBackgroundColor" value="#000000" /> <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" /> <preference name="StatusBarStyle" value="lightcontent" />
@ -197,6 +195,8 @@ Supported Platforms
StatusBar.styleBlackTranslucent 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). Use the blackTranslucent statusbar (light text, for dark backgrounds).
StatusBar.styleBlackTranslucent(); StatusBar.styleBlackTranslucent();
@ -212,6 +212,8 @@ Supported Platforms
StatusBar.styleBlackOpaque 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). Use the blackOpaque statusbar (light text, for dark backgrounds).
StatusBar.styleBlackOpaque(); StatusBar.styleBlackOpaque();

View File

@ -63,7 +63,11 @@ public class StatusBar extends CordovaPlugin {
setStatusBarBackgroundColor(preferences.getString("StatusBarBackgroundColor", "#000000")); setStatusBarBackgroundColor(preferences.getString("StatusBarBackgroundColor", "#000000"));
// Read 'StatusBarStyle' from config.xml, default is 'lightcontent'. // 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);
} }
}); });
} }

View File

@ -137,7 +137,11 @@ static const void *kStatusBarStyle = &kStatusBarStyle;
setting = @"StatusBarStyle"; setting = @"StatusBarStyle";
if ([self settingForKey:setting]) { 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"; setting = @"StatusBarDefaultScrollToTop";

View File

@ -59,12 +59,12 @@ var StatusBar = {
}, },
styleBlackTranslucent: function () { 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", []); exec(null, null, "StatusBar", "styleBlackTranslucent", []);
}, },
styleBlackOpaque: function () { 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", []); exec(null, null, "StatusBar", "styleBlackOpaque", []);
}, },