Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider Safe Area Insets for Some Screens #3084

Merged
merged 37 commits into from
Apr 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
113a568
Call screen safe area insets
ismailgulek Apr 9, 2020
5d9737f
Return to call button safe area insets
ismailgulek Apr 9, 2020
f3c4df8
JitsiViewController safe area insets
ismailgulek Apr 9, 2020
8f7b7fe
AuthenticationViewController safe area insets
ismailgulek Apr 9, 2020
5615463
Update CHANGES.rest, fixes #3067
ismailgulek Apr 9, 2020
578e240
Button inset logic refactored and moved to statusBarDidChangeFrame
ismailgulek Apr 10, 2020
f753d97
RoomViewController safe area insets
ismailgulek Apr 10, 2020
3ea5a00
SegmentedViewController safe area insets
ismailgulek Apr 10, 2020
ac3f3b2
RecentsViewController safe area insets
ismailgulek Apr 10, 2020
0e2648a
ContactsTableViewController safe area insets
ismailgulek Apr 10, 2020
1376c6b
RoomParticipantsViewController safe area insets
ismailgulek Apr 10, 2020
9a2bdef
RecentsViewController searchBar safe area insets, fixes #3070
ismailgulek Apr 10, 2020
a2e3535
ContactsTableViewController safe area insets, fixes #3072
ismailgulek Apr 10, 2020
475deda
Layout problem on back from RoomSearchViewController, fixes #3073
ismailgulek Apr 10, 2020
9270813
Layout problem on back from UnifiedSearchViewController, enhancement …
ismailgulek Apr 13, 2020
c7fe30d
RecentsViewController safe area insets
ismailgulek Apr 13, 2020
4b409e2
StartChatViewController safe area insets
ismailgulek Apr 13, 2020
3834381
RoomViewController bubblesTableView bottom constraint fix
ismailgulek Apr 14, 2020
ec9148f
SegmentedViewController bug fix: segments disappear when coming from …
ismailgulek Apr 16, 2020
7d5b7f1
Bug fix: When navigating back from a child page using edgeScreenPanRe…
ismailgulek Apr 16, 2020
cf29ff4
RoomMemberDetailsViewController bug fix: navigationBar was remaining …
ismailgulek Apr 16, 2020
3f6dd1a
SegmentedViewController allow scrollview content to be visible under …
ismailgulek Apr 17, 2020
e39e22b
StartChatViewController allow tableview content visible under home in…
ismailgulek Apr 17, 2020
42590b3
RecentsViewController plus button respect to safe area
ismailgulek Apr 17, 2020
90ebc08
RoomViewController fix redundant space on table bottom
ismailgulek Apr 17, 2020
a50358f
Section header views adaptation to safe area insets
ismailgulek Apr 21, 2020
d632ee8
RoomViewController navigation bar remaining translucent on some cases…
ismailgulek Apr 21, 2020
2259f02
RoomFilesViewController table view bottom inset reset bug fix
ismailgulek Apr 21, 2020
75eb8b0
RoomViewController set insets for jump button
ismailgulek Apr 21, 2020
8c6a179
ContactsTableViewController allow table row content be visible under …
ismailgulek Apr 21, 2020
1cb9829
RoomParticipantsViewController extend table row under home indicator
ismailgulek Apr 21, 2020
c5d8034
Fix RecentsViewController after rebase again
ismailgulek Apr 22, 2020
96d1403
Main.storyboard enable safe area layout guides
ismailgulek Apr 22, 2020
7dda136
SegmentedViewController table insets fix again
ismailgulek Apr 22, 2020
58de3a7
Some custom constraints on table view cells fixed for safe area
ismailgulek Apr 22, 2020
c642c41
Encryption info cell background color to safe area
ismailgulek Apr 22, 2020
9e01e22
AuthenticationViewController scroll view respect to safe area
ismailgulek Apr 22, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ Improvements:
Bug fix:
* Key backup banner is not hidden correctly (#2899).

Bug fix:
* Considered safe area insets for some screens (PR #3084).

Changes in 0.10.5 (2020-04-01)
===============================================

Expand Down
38 changes: 38 additions & 0 deletions Riot.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,12 @@
3AF393339D2D566CE14AC200 /* Pods_RiotTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 129EB7E27E7E4AC3F5F098F5 /* Pods_RiotTests.framework */; };
405FD41D306133A48D9B5AA1 /* Pods_RiotPods_Riot.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1ACF09217ADF1D7E7A35BC02 /* Pods_RiotPods_Riot.framework */; };
670966FEFE120D865FD8A5B6 /* Pods_RiotPods_SiriIntents.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 51187E952D5CECF6D6F5A28E /* Pods_RiotPods_SiriIntents.framework */; };
6E6F1CAA244DC1E90068B78B /* SectionHeaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6E6F1CA9244DC1E90068B78B /* SectionHeaderView.m */; };
6E6F1CAD244DDF3B0068B78B /* DirectorySectionHeaderContainerView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6E6F1CAC244DDF3B0068B78B /* DirectorySectionHeaderContainerView.m */; };
6E6F1CB1244E00FD0068B78B /* LocalContactsSectionHeaderContainerView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6E6F1CAF244E00FD0068B78B /* LocalContactsSectionHeaderContainerView.m */; };
6E6F1CB324506EC50068B78B /* UITableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E6F1CB224506EC50068B78B /* UITableViewCell.swift */; };
6E6F1CB524506FA40068B78B /* UITableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E6F1CB424506FA40068B78B /* UITableView.swift */; };
6E7A9E9C243E10E700FD039E /* UIDevice.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6E7A9E9B243E10E700FD039E /* UIDevice.swift */; };
926FA53F1F4C132000F826C2 /* MXSession+Riot.m in Sources */ = {isa = PBXBuildFile; fileRef = 926FA53E1F4C132000F826C2 /* MXSession+Riot.m */; };
92726A471F58737A004AD26F /* IntentHandler.m in Sources */ = {isa = PBXBuildFile; fileRef = 92726A461F58737A004AD26F /* IntentHandler.m */; };
92726A4B1F58737A004AD26F /* SiriIntents.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 92726A431F58737A004AD26F /* SiriIntents.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };
Expand Down Expand Up @@ -892,6 +898,15 @@
43C2962BE367F59220F517FA /* Pods-RiotPods-Riot.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RiotPods-Riot.debug.xcconfig"; path = "Target Support Files/Pods-RiotPods-Riot/Pods-RiotPods-Riot.debug.xcconfig"; sourceTree = "<group>"; };
4FC6A5D63FAD1B27C2F57AFA /* Pods-RiotPods-RiotShareExtension.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RiotPods-RiotShareExtension.release.xcconfig"; path = "Target Support Files/Pods-RiotPods-RiotShareExtension/Pods-RiotPods-RiotShareExtension.release.xcconfig"; sourceTree = "<group>"; };
51187E952D5CECF6D6F5A28E /* Pods_RiotPods_SiriIntents.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_RiotPods_SiriIntents.framework; sourceTree = BUILT_PRODUCTS_DIR; };
6E6F1CA8244DC1E90068B78B /* SectionHeaderView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SectionHeaderView.h; sourceTree = "<group>"; };
6E6F1CA9244DC1E90068B78B /* SectionHeaderView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SectionHeaderView.m; sourceTree = "<group>"; };
6E6F1CAB244DDF3B0068B78B /* DirectorySectionHeaderContainerView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DirectorySectionHeaderContainerView.h; sourceTree = "<group>"; };
6E6F1CAC244DDF3B0068B78B /* DirectorySectionHeaderContainerView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DirectorySectionHeaderContainerView.m; sourceTree = "<group>"; };
6E6F1CAF244E00FD0068B78B /* LocalContactsSectionHeaderContainerView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LocalContactsSectionHeaderContainerView.m; sourceTree = "<group>"; };
6E6F1CB0244E00FD0068B78B /* LocalContactsSectionHeaderContainerView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LocalContactsSectionHeaderContainerView.h; sourceTree = "<group>"; };
6E6F1CB224506EC50068B78B /* UITableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UITableViewCell.swift; sourceTree = "<group>"; };
6E6F1CB424506FA40068B78B /* UITableView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UITableView.swift; sourceTree = "<group>"; };
6E7A9E9B243E10E700FD039E /* UIDevice.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIDevice.swift; sourceTree = "<group>"; };
926FA53D1F4C132000F826C2 /* MXSession+Riot.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "MXSession+Riot.h"; sourceTree = "<group>"; };
926FA53E1F4C132000F826C2 /* MXSession+Riot.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "MXSession+Riot.m"; sourceTree = "<group>"; };
92726A431F58737A004AD26F /* SiriIntents.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = SiriIntents.appex; sourceTree = BUILT_PRODUCTS_DIR; };
Expand Down Expand Up @@ -2080,6 +2095,15 @@
name = Frameworks;
sourceTree = "<group>";
};
6E6F1CAE244DFB840068B78B /* SectionHeaders */ = {
isa = PBXGroup;
children = (
6E6F1CA8244DC1E90068B78B /* SectionHeaderView.h */,
6E6F1CA9244DC1E90068B78B /* SectionHeaderView.m */,
);
path = SectionHeaders;
sourceTree = "<group>";
};
92726A441F58737A004AD26F /* SiriIntents */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -3075,6 +3099,7 @@
B1B556CD20EE6C4C00210D55 /* Common */ = {
isa = PBXGroup;
children = (
6E6F1CAE244DFB840068B78B /* SectionHeaders */,
B183226923F59F3E0035B2E8 /* Buttons */,
B1963B3622933B9500CBA17F /* CollectionView */,
B1B556CE20EE6C4C00210D55 /* WebViewController */,
Expand Down Expand Up @@ -3411,6 +3436,8 @@
B1B5579D20EF58AC00210D55 /* Views */ = {
isa = PBXGroup;
children = (
6E6F1CB0244E00FD0068B78B /* LocalContactsSectionHeaderContainerView.h */,
6E6F1CAF244E00FD0068B78B /* LocalContactsSectionHeaderContainerView.m */,
B1B557A020EF58AC00210D55 /* ContactTableViewCell.h */,
B1B5579E20EF58AC00210D55 /* ContactTableViewCell.m */,
B1B5579F20EF58AC00210D55 /* ContactTableViewCell.xib */,
Expand Down Expand Up @@ -3795,6 +3822,8 @@
B1B5594F20EF9A8600210D55 /* RecentTableViewCell.h */,
B1B5595020EF9A8600210D55 /* RecentTableViewCell.m */,
B1B5595120EF9A8600210D55 /* RecentTableViewCell.xib */,
6E6F1CAB244DDF3B0068B78B /* DirectorySectionHeaderContainerView.h */,
6E6F1CAC244DDF3B0068B78B /* DirectorySectionHeaderContainerView.m */,
);
path = Views;
sourceTree = "<group>";
Expand Down Expand Up @@ -4236,6 +4265,7 @@
926FA53D1F4C132000F826C2 /* MXSession+Riot.h */,
926FA53E1F4C132000F826C2 /* MXSession+Riot.m */,
32242F0821E8B05F00725742 /* UIColor.swift */,
6E7A9E9B243E10E700FD039E /* UIDevice.swift */,
B1CA3A2621EF6913000D1D89 /* UIViewController.swift */,
B1CA3A2821EF692B000D1D89 /* UIView.swift */,
B140B4A121F87F7100E3F5FE /* OperationQueue.swift */,
Expand All @@ -4250,6 +4280,8 @@
B1B12B2822942315002CB419 /* UITouch.swift */,
B1DCC63322E72C1B00625807 /* UISearchBar.swift */,
B11291EB238D704C0077B478 /* FloatingPoint.swift */,
6E6F1CB224506EC50068B78B /* UITableViewCell.swift */,
6E6F1CB424506FA40068B78B /* UITableView.swift */,
);
path = Categories;
sourceTree = "<group>";
Expand Down Expand Up @@ -4920,6 +4952,7 @@
B1B5574B20EE6C4D00210D55 /* MediaAlbumContentViewController.m in Sources */,
B1B5598820EFC3E000210D55 /* WidgetManager.m in Sources */,
B1DB4F0E22316FFF0065DBFA /* UserNameColorGenerator.swift in Sources */,
6E6F1CB524506FA40068B78B /* UITableView.swift in Sources */,
B157FAA123264AE900EBFBD4 /* SettingsDiscoveryThreePidDetailsCoordinatorType.swift in Sources */,
32607D6C243E0A55006674CC /* KeyBackupRecoverFromPrivateKeyViewController.swift in Sources */,
B1057789221304EC00334B1E /* KeyBackupSetupSuccessFromPassphraseViewController.swift in Sources */,
Expand Down Expand Up @@ -4979,6 +5012,7 @@
B157FAA823264BED00EBFBD4 /* SettingsDiscoveryThreePidDetailsCoordinatorBridgePresenter.swift in Sources */,
B169330B20F3CA3A00746532 /* Contact.m in Sources */,
B1A5B33E227ADF2A004CBA85 /* UIImage.swift in Sources */,
6E6F1CB324506EC50068B78B /* UITableViewCell.swift in Sources */,
B1D4752A21EE52B10067973F /* KeyBackupSetupIntroViewController.swift in Sources */,
B108931F23AB80EF00802670 /* KeyVerificationIncomingRequestApprovalBubbleCell.swift in Sources */,
B1CE83D42422817200D07506 /* KeyVerificationVerifiedViewController.swift in Sources */,
Expand Down Expand Up @@ -5295,6 +5329,7 @@
B1C562E1228C7C8C0037F12A /* RoomContextualMenuToolbarView.swift in Sources */,
B1CE83DF2422817200D07506 /* KeyVerificationVerifyBySASCoordinatorType.swift in Sources */,
B1B557BF20EF5B4500210D55 /* DisabledRoomInputToolbarView.m in Sources */,
6E6F1CAD244DDF3B0068B78B /* DirectorySectionHeaderContainerView.m in Sources */,
B157A7BB2445BD86008A5504 /* KeyVerificationScanConfirmationCoordinatorType.swift in Sources */,
B1B5578620EF564900210D55 /* GroupTableViewCellWithSwitch.m in Sources */,
B1098BE821ECFE52000DDA48 /* Coordinator.swift in Sources */,
Expand Down Expand Up @@ -5326,6 +5361,7 @@
B1B557AC20EF5A6D00210D55 /* DeviceView.m in Sources */,
3281BCF72201FA4200F4A383 /* UIControl.swift in Sources */,
B16932EE20F3C3C900746532 /* FilesSearchCellData.m in Sources */,
6E6F1CB1244E00FD0068B78B /* LocalContactsSectionHeaderContainerView.m in Sources */,
B1B558E520EF768F00210D55 /* RoomMembershipExpandedBubbleCell.m in Sources */,
32BF995121FA29DC00698084 /* SettingsKeyBackupViewModelType.swift in Sources */,
B190F55922CE356800AEB493 /* EditHistoryHeaderView.swift in Sources */,
Expand All @@ -5340,6 +5376,7 @@
B1D211E422C18E3800D939BD /* ReactionsMenuViewModelType.swift in Sources */,
324A2055225FC571004FE8B0 /* DeviceVerificationIncomingViewModelType.swift in Sources */,
B1B5572C20EE6C4D00210D55 /* RoomParticipantsViewController.m in Sources */,
6E6F1CAA244DC1E90068B78B /* SectionHeaderView.m in Sources */,
B1B558EE20EF768F00210D55 /* RoomOutgoingAttachmentBubbleCell.m in Sources */,
32BF994F21FA29A400698084 /* SettingsKeyBackupViewModel.swift in Sources */,
B190F55D22CE5A9700AEB493 /* EditHistorySection.swift in Sources */,
Expand Down Expand Up @@ -5389,6 +5426,7 @@
B1E5368921FB1E20001F3AFF /* UIButton.swift in Sources */,
B1DCC63422E72C1B00625807 /* UISearchBar.swift in Sources */,
32A6001622C661100042C1D9 /* EditHistoryViewState.swift in Sources */,
6E7A9E9C243E10E700FD039E /* UIDevice.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
64 changes: 53 additions & 11 deletions Riot/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -4081,6 +4081,11 @@ - (void)presentJitsiViewController:(void (^)(void))completion

if (_jitsiViewController)
{
if (@available(iOS 13.0, *))
{
_jitsiViewController.modalPresentationStyle = UIModalPresentationFullScreen;
}

[self presentViewController:_jitsiViewController animated:YES completion:completion];
}
}
Expand Down Expand Up @@ -4232,11 +4237,26 @@ - (void)askNativeWidgetPermissionWithWidget:(Widget*)widget completion:(void (^)

#pragma mark - Call status handling

/// Returns a suitable height for call status bar. Considers safe area insets if available and notch status.
- (CGFloat)calculateCallStatusBarHeight
{
CGFloat result = CALL_STATUS_BAR_HEIGHT;
if (@available(iOS 11.0, *))
{
if (UIDevice.currentDevice.hasNotch)
{
// this device has a notch (iPhone X +)
result += UIApplication.sharedApplication.keyWindow.safeAreaInsets.top;
}
Comment on lines +4246 to +4250
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of using hasNotch we could use this:

        static CGFloat kCallStatusBarSafeAreaExtraHeight = 24;        
        result = MAX(UIApplication.sharedApplication.keyWindow.safeAreaInsets.top + kCallStatusBarSafeAreaExtraHeight, CALL_STATUS_BAR_HEIGHT);

}
return result;
}

- (void)addCallStatusBar:(NSString*)buttonTitle
{
// Add a call status bar
CGSize topBarSize = CGSizeMake([[UIScreen mainScreen] bounds].size.width, CALL_STATUS_BAR_HEIGHT);
CGSize topBarSize = CGSizeMake([[UIScreen mainScreen] bounds].size.width, [self calculateCallStatusBarHeight]);

_callStatusBarWindow = [[UIWindow alloc] initWithFrame:CGRectMake(0, 0, topBarSize.width, topBarSize.height)];
_callStatusBarWindow.windowLevel = UIWindowLevelStatusBar;

Expand All @@ -4246,8 +4266,9 @@ - (void)addCallStatusBar:(NSString*)buttonTitle

[_callStatusBarButton setTitle:buttonTitle forState:UIControlStateNormal];
[_callStatusBarButton setTitle:buttonTitle forState:UIControlStateHighlighted];

_callStatusBarButton.titleLabel.textColor = ThemeService.shared.theme.backgroundColor;

_callStatusBarButton.titleLabel.font = [UIFont systemFontOfSize:17 weight:UIFontWeightMedium];

[_callStatusBarButton setBackgroundColor:ThemeService.shared.theme.tintColor];
Expand Down Expand Up @@ -4322,6 +4343,11 @@ - (void)presentCallViewController:(BOOL)animated completion:(void (^)(void))comp

if (currentCallViewController)
{
if (@available(iOS 13.0, *))
{
currentCallViewController.modalPresentationStyle = UIModalPresentationFullScreen;
}

[self presentViewController:currentCallViewController animated:animated completion:completion];
}
}
Expand All @@ -4333,36 +4359,52 @@ - (void)statusBarDidChangeFrame

// Refresh the root view controller frame
CGRect rootControllerFrame = [[UIScreen mainScreen] bounds];

if (_callStatusBarWindow)
{
CGFloat callStatusBarHeight = [self calculateCallStatusBarHeight];

UIInterfaceOrientation statusBarOrientation = [UIApplication sharedApplication].statusBarOrientation;

switch (statusBarOrientation)
{
case UIInterfaceOrientationLandscapeLeft:
{
_callStatusBarWindow.frame = CGRectMake(-rootControllerFrame.size.width / 2, -CALL_STATUS_BAR_HEIGHT / 2, rootControllerFrame.size.width, CALL_STATUS_BAR_HEIGHT);
_callStatusBarWindow.transform = CGAffineTransformMake(0, -1, 1, 0, CALL_STATUS_BAR_HEIGHT / 2, rootControllerFrame.size.width / 2);
_callStatusBarWindow.frame = CGRectMake(-rootControllerFrame.size.width / 2, -callStatusBarHeight / 2, rootControllerFrame.size.width, callStatusBarHeight);
_callStatusBarWindow.transform = CGAffineTransformMake(0, -1, 1, 0, callStatusBarHeight / 2, rootControllerFrame.size.width / 2);
break;
}
case UIInterfaceOrientationLandscapeRight:
{
_callStatusBarWindow.frame = CGRectMake(-rootControllerFrame.size.width / 2, -CALL_STATUS_BAR_HEIGHT / 2, rootControllerFrame.size.width, CALL_STATUS_BAR_HEIGHT);
_callStatusBarWindow.transform = CGAffineTransformMake(0, 1, -1, 0, rootControllerFrame.size.height - CALL_STATUS_BAR_HEIGHT / 2, rootControllerFrame.size.width / 2);
_callStatusBarWindow.frame = CGRectMake(-rootControllerFrame.size.width / 2, -callStatusBarHeight / 2, rootControllerFrame.size.width, callStatusBarHeight);
_callStatusBarWindow.transform = CGAffineTransformMake(0, 1, -1, 0, rootControllerFrame.size.height - callStatusBarHeight / 2, rootControllerFrame.size.width / 2);
break;
}
default:
{
_callStatusBarWindow.transform = CGAffineTransformIdentity;
_callStatusBarWindow.frame = CGRectMake(0, 0, rootControllerFrame.size.width, CALL_STATUS_BAR_HEIGHT);
_callStatusBarWindow.frame = CGRectMake(0, 0, rootControllerFrame.size.width, callStatusBarHeight);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Above if (_callStatusBarWindow) we can add:
UIEdgeInsets callBarButtonContentEdgeInsets = UIEdgeInsetsZero;
and here we can add:

                if (@available(iOS 11.0, *))
                {
                    callBarButtonContentEdgeInsets.top = callStatusBarHeight - CALL_STATUS_BAR_HEIGHT;
                }

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done with some changes.

break;
}
}

UIEdgeInsets callBarButtonContentEdgeInsets = UIEdgeInsetsZero;

if (@available(iOS 11.0, *))
{
callBarButtonContentEdgeInsets = UIApplication.sharedApplication.keyWindow.safeAreaInsets;
// should override top inset
callBarButtonContentEdgeInsets.top = callStatusBarHeight - CALL_STATUS_BAR_HEIGHT;
// should ignore bottom inset
callBarButtonContentEdgeInsets.bottom = 0.0;
// should keep left, and right insets as original
}

_callStatusBarButton.contentEdgeInsets = callBarButtonContentEdgeInsets;

// Apply the vertical offset due to call status bar
rootControllerFrame.origin.y = CALL_STATUS_BAR_HEIGHT;
rootControllerFrame.size.height -= CALL_STATUS_BAR_HEIGHT;
rootControllerFrame.origin.y = callStatusBarHeight;
rootControllerFrame.size.height -= callStatusBarHeight;
}

rootController.view.frame = rootControllerFrame;
Expand Down
Loading