This is an automated email from the ASF dual-hosted git repository.
niklasmerz pushed a commit to branch master
in repository
https://gitbox.apache.org/repos/asf/cordova-plugin-inappbrowser.git
The following commit(s) were added to refs/heads/master by this push:
new 6b92084 feat(ios): add InAppBrowserStatusBarStyle 'darkcontent'
configuration option (#828)
6b92084 is described below
commit 6b920849ccd381758210297f9b1eca8659be249c
Author: Niklas Merz <[email protected]>
AuthorDate: Tue Feb 9 08:24:56 2021 +0100
feat(ios): add InAppBrowserStatusBarStyle 'darkcontent' configuration
option (#828)
Co-authored-by: Tim Brust <[email protected]>
---
README.md | 2 +-
src/ios/CDVWKInAppBrowser.m | 6 ++++++
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 5e33249..c30e17e 100644
--- a/README.md
+++ b/README.md
@@ -71,7 +71,7 @@ simply hook `window.open` during initialization. For example:
### Preferences
#### <b>config.xml</b>
-- <b>InAppBrowserStatusBarStyle [iOS only]</b>: (string, options
'lightcontent' or 'default'. Defaults to 'default') set text color style for
iOS.
+- <b>InAppBrowserStatusBarStyle [iOS only]</b>: (string, options
'lightcontent', 'darkcontent' or 'default'. Defaults to 'default') set text
color style for iOS. 'lightcontent' is intended for use on dark backgrounds.
'darkcontent' is only available since iOS 13 and intended for use on light
backgrounds.
```
<preference name="InAppBrowserStatusBarStyle" value="lightcontent" />
```
diff --git a/src/ios/CDVWKInAppBrowser.m b/src/ios/CDVWKInAppBrowser.m
index 70d7e8f..cf4b6f6 100644
--- a/src/ios/CDVWKInAppBrowser.m
+++ b/src/ios/CDVWKInAppBrowser.m
@@ -1071,6 +1071,12 @@ BOOL isExiting = FALSE;
NSString* statusBarStylePreference = [self
settingForKey:@"InAppBrowserStatusBarStyle"];
if (statusBarStylePreference && [statusBarStylePreference
isEqualToString:@"lightcontent"]) {
return UIStatusBarStyleLightContent;
+ } else if (statusBarStylePreference && [statusBarStylePreference
isEqualToString:@"darkcontent"]) {
+ if (@available(iOS 13.0, *)) {
+ return UIStatusBarStyleDarkContent;
+ } else {
+ return UIStatusBarStyleDefault;
+ }
} else {
return UIStatusBarStyleDefault;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]