CR: annotate device constants

// FREEBIE
pull/1/head
Michael Kirk 7 years ago committed by Matthew Chen
parent 36ee6af621
commit fc34a0643c

@ -116,7 +116,9 @@ NS_ASSUME_NONNULL_BEGIN
if (OWSWindowManager.sharedManager.hasCall) {
if (UIDevice.currentDevice.isIPhoneX) {
// iPhoneX computes status bar height differently.
// IOS_DEVICE_CONSTANT
self.additionalSafeAreaInsets = UIEdgeInsetsMake(navbar.navbarWithoutStatusHeight + 20, 0, 0, 0);
} else {
self.additionalSafeAreaInsets
= UIEdgeInsetsMake(navbar.navbarWithoutStatusHeight + CurrentAppContext().statusBarHeight, 0, 0, 0);

@ -23,6 +23,7 @@ public extension UIDevice {
case 2436:
return true
default:
// Verify all our IOS_DEVICE_CONSTANT tags make sense when adding a new device size.
owsFail("\(logTag) in \(#function) unknown device format")
return false
}

@ -19,8 +19,10 @@ const CGFloat OWSWindowManagerCallScreenHeight(void)
// On an iPhoneX, the system return-to-call banner has been replaced by a much subtler green
// circle behind the system clock. Instead, we mimic the old system call banner as on older devices,
// but it has to be taller to fit beneath the notch.
// IOS_DEVICE_CONSTANT, we'll want to revisit this when new device dimensions are introduced.
return 64;
} else {
return CurrentAppContext().statusBarHeight + 20;
}
}

Loading…
Cancel
Save