-
Notifications
You must be signed in to change notification settings - Fork 493
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
Conversation
import Foundation | ||
import UIKit | ||
|
||
@objc extension UIDevice { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can manage safe area without this code atm. It could be dangerous to use magic numbers as those values could change for an iOS version or an iOS device.
if (UIDevice.currentDevice.hasNotch) | ||
{ | ||
// this device has a notch (iPhone X +) | ||
result += UIApplication.sharedApplication.keyWindow.safeAreaInsets.top; | ||
} |
There was a problem hiding this comment.
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);
Riot/AppDelegate.m
Outdated
if (@available(iOS 11.0, *)) | ||
{ | ||
UIEdgeInsets safeAreaInsets = UIApplication.sharedApplication.keyWindow.safeAreaInsets; | ||
safeAreaInsets.top = topBarSize.height - CALL_STATUS_BAR_HEIGHT; | ||
safeAreaInsets.bottom = 0.0; | ||
_callStatusBarButton.titleEdgeInsets = safeAreaInsets; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can move this behavior to statusBarDidChangeFrame
method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
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); |
There was a problem hiding this comment.
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;
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done with some changes.
8f5e1cb
to
8533fd5
Compare
…for #3084 Signed-off-by: ismailgulek <gulekismail@gmail.com>
General comments for devices with a notch:
Here some regressions for left/right safe area in landascape: Here some regressions about home indicator underlap: |
Signed-off-by: ismailgulek <gulekismail@gmail.com>
Signed-off-by: ismailgulek <gulekismail@gmail.com>
Signed-off-by: ismailgulek <gulekismail@gmail.com>
Signed-off-by: ismailgulek <gulekismail@gmail.com>
Signed-off-by: ismailgulek <gulekismail@gmail.com>
Signed-off-by: ismailgulek <gulekismail@gmail.com>
Signed-off-by: ismailgulek <gulekismail@gmail.com>
Signed-off-by: ismailgulek <gulekismail@gmail.com>
Signed-off-by: ismailgulek <gulekismail@gmail.com>
Signed-off-by: ismailgulek <gulekismail@gmail.com>
Signed-off-by: ismailgulek <gulekismail@gmail.com>
…for #3084 Signed-off-by: ismailgulek <gulekismail@gmail.com>
Signed-off-by: ismailgulek <gulekismail@gmail.com>
Signed-off-by: ismailgulek <gulekismail@gmail.com>
Signed-off-by: ismailgulek <gulekismail@gmail.com>
…a view with translucent bar Signed-off-by: ismailgulek <gulekismail@gmail.com>
…cognizer, do not destroy child pages until navigation completed Signed-off-by: ismailgulek <gulekismail@gmail.com>
…translucent Signed-off-by: ismailgulek <gulekismail@gmail.com>
…home indicator Signed-off-by: ismailgulek <gulekismail@gmail.com>
…dicator Signed-off-by: ismailgulek <gulekismail@gmail.com>
Signed-off-by: ismailgulek <gulekismail@gmail.com>
Signed-off-by: ismailgulek <gulekismail@gmail.com>
Signed-off-by: ismailgulek <gulekismail@gmail.com>
… bug fix Signed-off-by: ismailgulek <gulekismail@gmail.com>
Signed-off-by: ismailgulek <gulekismail@gmail.com>
Signed-off-by: ismailgulek <gulekismail@gmail.com>
…home indicator Signed-off-by: ismailgulek <gulekismail@gmail.com>
Signed-off-by: ismailgulek <gulekismail@gmail.com>
Signed-off-by: ismailgulek <gulekismail@gmail.com>
Signed-off-by: ismailgulek <gulekismail@gmail.com>
Signed-off-by: ismailgulek <gulekismail@gmail.com>
Signed-off-by: ismailgulek <gulekismail@gmail.com>
Signed-off-by: ismailgulek <gulekismail@gmail.com>
Signed-off-by: ismailgulek <gulekismail@gmail.com>
No description provided.