refactor!: remove deprecated methods (#229)

This commit is contained in:
jcesarmobile
2022-09-05 23:20:52 +02:00
committed by GitHub
parent 49b94aed6a
commit fbe33eb327
9 changed files with 3 additions and 135 deletions
+1 -26
View File
@@ -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'");
}
}
}
-2
View File
@@ -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,
-2
View File
@@ -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;
+1 -18
View File
@@ -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];
-10
View File
@@ -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()) {