Compare commits

...
14 Commits
Author SHA1 Message Date
Steve Gill fbc4862dbd CB-14030 Updated version and RELEASENOTES.md for release 2.4.2 (via coho) 2018-04-12 17:06:22 -07:00
jcesarmobileandGitHub 4c1507b525 Merge pull request #95 from jcesarmobile/CB-12679
CB-12679: Remove Permissions section
2018-01-12 10:55:33 +01:00
Julio César 62e8a187c1 CB-12679: Remove Permissions section 2018-01-11 23:13:12 +01:00
jcesarmobileandGitHub e3138a9f08 Merge pull request #94 from jcesarmobile/CB-13754
CB-13754: Add build-tools-26.0.2 to travis
2018-01-10 23:45:04 +01:00
Julio César f1407e7ae5 CB-13754: Add build-tools-26.0.2 to travis 2018-01-10 00:19:36 +01:00
jcesarmobileandSimon MacDonald 70a421bd25 Fix release notes (#93) 2017-12-30 00:55:27 -05:00
Simon MacDonald bca70c21e9 Set VERSION to 2.4.2-dev (via coho) 2017-12-27 19:13:50 -05:00
Simon MacDonald 4988b6fec3 CB-13714 Updated version and RELEASENOTES.md for release 2.4.1 (via coho) 2017-12-27 19:13:36 -05:00
jcesarmobileandSimon MacDonald 8da38f5075 CB-13712 (iOS): fix overlaysWebView reset on rotation (#92) 2017-12-27 10:43:58 -05:00
Steve Gill 6352d80a96 Set VERSION to 2.4.1-dev (via coho) 2017-12-15 17:26:45 -08:00
Steve Gill caf2ae6605 CB-13681 Updated version and RELEASENOTES.md for release 2.4.0 (via coho) 2017-12-15 17:25:13 -08:00
Steve GillandGitHub 3d614115b8 Merge pull request #91 from jcesarmobile/CB-13623
CB-13623 (iOS): Remove iOS 6-7 code
2017-12-15 16:29:02 -08:00
Julio César 9a976a9744 CB-13623 (iOS): Remove iOS 6-7 code 2017-12-01 00:30:35 +01:00
Steve Gill 611169c89f Set VERSION to 2.3.1-dev (via coho) 2017-11-06 14:38:40 -08:00
7 changed files with 62 additions and 101 deletions
+4
View File
@@ -41,6 +41,7 @@ matrix:
android:
components:
- tools
- build-tools-26.0.2
- env: PLATFORM=android-5.1
os: linux
language: android
@@ -48,6 +49,7 @@ matrix:
android:
components:
- tools
- build-tools-26.0.2
- env: PLATFORM=android-6.0
os: linux
language: android
@@ -55,6 +57,7 @@ matrix:
android:
components:
- tools
- build-tools-26.0.2
- env: PLATFORM=android-7.0
os: linux
language: android
@@ -62,6 +65,7 @@ matrix:
android:
components:
- tools
- build-tools-26.0.2
before_install:
- rm -rf ~/.nvm && git clone https://github.com/creationix/nvm.git ~/.nvm && (cd ~/.nvm
&& git checkout `git describe --abbrev=0 --tags`) && source ~/.nvm/nvm.sh && nvm
-9
View File
@@ -122,15 +122,6 @@ Events
- statusTap
Permissions
-----------
#### config.xml
<feature name="StatusBar">
<param name="ios-package" value="CDVStatusBar" onload="true" />
</feature>
StatusBar.overlaysWebView
=================
+9
View File
@@ -20,6 +20,15 @@
-->
# Release Notes
### 2.4.2 (Apr 12, 2018)
* [CB-12679](https://issues.apache.org/jira/browse/CB-12679) Remove Permissions section
### 2.4.1 (Dec 27, 2017)
* [CB-13712](https://issues.apache.org/jira/browse/CB-13712) (iOS): fix overlaysWebView reset on rotation (#92)
### 2.4.0 (Dec 15, 2017)
* [CB-13623](https://issues.apache.org/jira/browse/CB-13623) (iOS): Remove **iOS** 6-7 code
### 2.3.0 (Nov 06, 2017)
* [CB-13476](https://issues.apache.org/jira/browse/CB-13476) (iOS): handle double size statusbar on SDK 10 for **iOS 11**
* [CB-13394](https://issues.apache.org/jira/browse/CB-13394) (iOS): fix `iPhone X` StatusBar rendering in landscape
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "cordova-plugin-statusbar",
"version": "2.3.0",
"version": "2.4.2",
"description": "Cordova StatusBar Plugin",
"types": "./types/index.d.ts",
"cordova": {
+1 -1
View File
@@ -22,7 +22,7 @@
xmlns:rim="http://www.blackberry.com/ns/widgets"
xmlns:android="http://schemas.android.com/apk/res/android"
id="cordova-plugin-statusbar"
version="2.3.0">
version="2.4.2">
<name>StatusBar</name>
<description>Cordova StatusBar Plugin</description>
<license>Apache 2.0</license>
+46 -89
View File
@@ -97,21 +97,19 @@ static const void *kStatusBarStyle = &kStatusBarStyle;
-(void)statusBarDidChangeFrame:(NSNotification*)notification
{
//add a small delay for iOS 7 ( 0.1 seconds )
//add a small delay ( 0.1 seconds ) or statusbar size will be wrong
__weak CDVStatusBar* weakSelf = self;
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.1 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
[self resizeStatusBarBackgroundView];
[weakSelf resizeStatusBarBackgroundView];
[weakSelf resizeWebView];
});
}
- (void)pluginInitialize
{
BOOL isiOS7 = (IsAtLeastiOSVersion(@"7.0"));
// init
NSNumber* uiviewControllerBasedStatusBarAppearance = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"UIViewControllerBasedStatusBarAppearance"];
_uiviewControllerBasedStatusBarAppearance = (uiviewControllerBasedStatusBarAppearance == nil || [uiviewControllerBasedStatusBarAppearance boolValue]) && isiOS7;
_uiviewControllerBasedStatusBarAppearance = (uiviewControllerBasedStatusBarAppearance == nil || [uiviewControllerBasedStatusBarAppearance boolValue]);
// observe the statusBarHidden property
[[UIApplication sharedApplication] addObserver:self forKeyPath:@"statusBarHidden" options:NSKeyValueObservingOptionNew context:NULL];
@@ -206,31 +204,16 @@ static const void *kStatusBarStyle = &kStatusBarStyle;
statusBarFrame.origin.y = 0;
}
statusBarFrame = [self invertFrameIfNeeded:statusBarFrame];
_statusBarBackgroundView = [[UIView alloc] initWithFrame:statusBarFrame];
_statusBarBackgroundView.backgroundColor = _statusBarBackgroundColor;
_statusBarBackgroundView.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleBottomMargin);
_statusBarBackgroundView.autoresizesSubviews = YES;
}
- (CGRect) invertFrameIfNeeded:(CGRect)rect {
// landscape is where (width > height). On iOS < 8, we need to invert since frames are
// always in Portrait context. Do not run this on ios 8 or above to avoid breaking ipad pro multitask layout
if (!IsAtLeastiOSVersion(@"8.0") && UIInterfaceOrientationIsLandscape([[UIApplication sharedApplication] statusBarOrientation])) {
CGFloat temp = rect.size.width;
rect.size.width = rect.size.height;
rect.size.height = temp;
rect.origin = CGPointZero;
}
return rect;
}
- (void) setStatusBarOverlaysWebView:(BOOL)statusBarOverlaysWebView
{
// we only care about the latest iOS version or a change in setting
if (!IsAtLeastiOSVersion(@"7.0") || statusBarOverlaysWebView == _statusBarOverlaysWebView) {
if (statusBarOverlaysWebView == _statusBarOverlaysWebView) {
return;
}
@@ -317,22 +300,12 @@ static const void *kStatusBarStyle = &kStatusBarStyle;
- (void) styleBlackTranslucent:(CDVInvokedUrlCommand*)command
{
#if __IPHONE_OS_VERSION_MAX_ALLOWED < 70000
# define TRANSLUCENT_STYLE UIStatusBarStyleBlackTranslucent
#else
# define TRANSLUCENT_STYLE UIStatusBarStyleLightContent
#endif
[self setStyleForStatusBar:TRANSLUCENT_STYLE];
[self setStyleForStatusBar:UIStatusBarStyleLightContent];
}
- (void) styleBlackOpaque:(CDVInvokedUrlCommand*)command
{
#if __IPHONE_OS_VERSION_MAX_ALLOWED < 70000
# define OPAQUE_STYLE UIStatusBarStyleBlackOpaque
#else
# define OPAQUE_STYLE UIStatusBarStyleLightContent
#endif
[self setStyleForStatusBar:OPAQUE_STYLE];
[self setStyleForStatusBar:UIStatusBarStyleLightContent];
}
- (void) backgroundColorByName:(CDVInvokedUrlCommand*)command
@@ -396,9 +369,7 @@ static const void *kStatusBarStyle = &kStatusBarStyle;
[self hideStatusBar];
if (IsAtLeastiOSVersion(@"7.0")) {
[_statusBarBackgroundView removeFromSuperview];
}
[_statusBarBackgroundView removeFromSuperview];
[self resizeWebView];
@@ -426,22 +397,16 @@ static const void *kStatusBarStyle = &kStatusBarStyle;
if (app.isStatusBarHidden)
{
BOOL isIOS7 = (IsAtLeastiOSVersion(@"7.0"));
[self showStatusBar];
[self resizeWebView];
if (isIOS7) {
if (!self.statusBarOverlaysWebView) {
if (!self.statusBarOverlaysWebView) {
// there is a possibility that when the statusbar was hidden, it was in a different orientation
// from the current one. Therefore we need to expand the statusBarBackgroundView as well to the
// statusBar's current size
[self resizeStatusBarBackgroundView];
[self.webView.superview addSubview:_statusBarBackgroundView];
}
// there is a possibility that when the statusbar was hidden, it was in a different orientation
// from the current one. Therefore we need to expand the statusBarBackgroundView as well to the
// statusBar's current size
[self resizeStatusBarBackgroundView];
[self.webView.superview addSubview:_statusBarBackgroundView];
}
@@ -451,7 +416,6 @@ static const void *kStatusBarStyle = &kStatusBarStyle;
-(void)resizeStatusBarBackgroundView {
CGRect statusBarFrame = [UIApplication sharedApplication].statusBarFrame;
statusBarFrame = [self invertFrameIfNeeded:statusBarFrame];
CGRect sbBgFrame = _statusBarBackgroundView.frame;
sbBgFrame.size = statusBarFrame.size;
_statusBarBackgroundView.frame = sbBgFrame;
@@ -459,49 +423,42 @@ static const void *kStatusBarStyle = &kStatusBarStyle;
-(void)resizeWebView
{
BOOL isIOS7 = (IsAtLeastiOSVersion(@"7.0"));
BOOL isIOS11 = (IsAtLeastiOSVersion(@"11.0"));
if (isIOS7) {
CGRect bounds = [self.viewController.view.window bounds];
if (CGRectEqualToRect(bounds, CGRectZero)) {
bounds = [[UIScreen mainScreen] bounds];
}
bounds = [self invertFrameIfNeeded:bounds];
self.viewController.view.frame = bounds;
self.webView.frame = bounds;
CGRect statusBarFrame = [UIApplication sharedApplication].statusBarFrame;
statusBarFrame = [self invertFrameIfNeeded:statusBarFrame];
CGRect frame = self.webView.frame;
CGFloat height = statusBarFrame.size.height;
if (!self.statusBarOverlaysWebView) {
frame.origin.y = height;
} else {
frame.origin.y = height >= 20 ? height - 20 : 0;
if (isIOS11) {
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000
if (@available(iOS 11.0, *)) {
float safeAreaTop = self.webView.safeAreaInsets.top;
if (height >= safeAreaTop && safeAreaTop >0) {
// Sometimes when in-call/recording/hotspot larger status bar is present, the safeAreaTop is 40 but we want frame.origin.y to be 20
frame.origin.y = safeAreaTop == 40 ? 20 : height - safeAreaTop;
} else {
frame.origin.y = 0;
}
}
#endif
}
}
frame.size.height -= frame.origin.y;
self.webView.frame = frame;
} else {
CGRect bounds = [[UIScreen mainScreen] applicationFrame];
self.viewController.view.frame = bounds;
CGRect bounds = [self.viewController.view.window bounds];
if (CGRectEqualToRect(bounds, CGRectZero)) {
bounds = [[UIScreen mainScreen] bounds];
}
self.viewController.view.frame = bounds;
self.webView.frame = bounds;
CGRect statusBarFrame = [UIApplication sharedApplication].statusBarFrame;
CGRect frame = self.webView.frame;
CGFloat height = statusBarFrame.size.height;
if (!self.statusBarOverlaysWebView) {
frame.origin.y = height;
} else {
frame.origin.y = height >= 20 ? height - 20 : 0;
if (isIOS11) {
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000
if (@available(iOS 11.0, *)) {
float safeAreaTop = self.webView.safeAreaInsets.top;
if (height >= safeAreaTop && safeAreaTop >0) {
// Sometimes when in-call/recording/hotspot larger status bar is present, the safeAreaTop is 40 but we want frame.origin.y to be 20
frame.origin.y = safeAreaTop == 40 ? 20 : height - safeAreaTop;
} else {
frame.origin.y = 0;
}
}
#endif
}
}
frame.size.height -= frame.origin.y;
self.webView.frame = frame;
}
- (void) dealloc
+1 -1
View File
@@ -22,7 +22,7 @@
xmlns:rim="http://www.blackberry.com/ns/widgets"
xmlns:android="http://schemas.android.com/apk/res/android"
id="cordova-plugin-statusbar-tests"
version="2.3.0">
version="2.4.2">
<name>Cordova StatusBar Plugin Tests</name>
<license>Apache 2.0</license>