Skip to content

Commit

Permalink
Revert "Update notch behaviour"
Browse files Browse the repository at this point in the history
This reverts commit e8f4f9e.
  • Loading branch information
alexyazvinsky committed Jul 9, 2019
1 parent 3d1ce39 commit cde1a70
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions src/ios/CDVInAppBrowserNavigationController.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ Licensed to the Apache Software Foundation (ASF) under one

#import "CDVInAppBrowserNavigationController.h"

#define STATUSBAR_WITH_NOTCH_HEIGHT 44.0
#define STATUSBAR_HEIGHT 20.0

@implementation CDVInAppBrowserNavigationController : UINavigationController
Expand All @@ -30,22 +29,10 @@ - (void) dismissViewControllerAnimated:(BOOL)flag completion:(void (^)(void))com
}
}

- (BOOL)hasTopNotch {
if (@available(iOS 11.0, *)) {
return [[[UIApplication sharedApplication] delegate] window].safeAreaInsets.top > 20.0;
}

return NO;
}

- (void) viewDidLoad {

CGRect statusBarFrame = [self invertFrameIfNeeded:[UIApplication sharedApplication].statusBarFrame];
if([self hasTopNotch]){
statusBarFrame.size.height = STATUSBAR_WITH_NOTCH_HEIGHT;
}else{
statusBarFrame.size.height = STATUSBAR_HEIGHT;
}
statusBarFrame.size.height = STATUSBAR_HEIGHT;
// simplified from: http://stackoverflow.com/a/25669695/219684

UIToolbar* bgToolbar = [[UIToolbar alloc] initWithFrame:statusBarFrame];
Expand Down

0 comments on commit cde1a70

Please sign in to comment.