Skip to content

Commit

Permalink
Fixed layouts for new iPad Pro with OLED displays
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlos Cabanero committed Jun 14, 2024
1 parent d05265c commit 87ada79
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions Blink/LayoutManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,13 @@ + (UIEdgeInsets) buildSafeInsetsForController:(UIViewController *)ctrl andMode:(
result = deviceMargins;
if (DeviceInfo.shared.hasCorners &&
UIDevice.currentDevice.userInterfaceIdiom == UIUserInterfaceIdiomPad) {
result.top = 16;
result.bottom = 16;
if ([DeviceInfo.shared.marketingName containsString:@"M4"]) {
result.top = 25;
result.bottom = 25;
} else {
result.top = 16;
result.bottom = 16;
}
}

break;
Expand All @@ -108,10 +113,17 @@ + (UIEdgeInsets) buildSafeInsetsForController:(UIViewController *)ctrl andMode:(
}

if (!deviceInfo.hasNotch) {
result.top = 5;
result.left = 5;
result.right = MAX(deviceMargins.right, 5);
result.bottom = fullScreen ? 5 : 10;
if ([DeviceInfo.shared.marketingName containsString:@"M4"]) {
result.top = 8;
result.left = 8;
result.right = MAX(deviceMargins.right, 8);
result.bottom = fullScreen ? 8 : 10;
} else {
result.top = 5;
result.left = 5;
result.right = MAX(deviceMargins.right, 5);
result.bottom = fullScreen ? 5 : 10;
}
break;
}

Expand Down

0 comments on commit 87ada79

Please sign in to comment.