Skip to content

Commit

Permalink
Update: 更新刘海屏的判断 (Tencent#85)
Browse files Browse the repository at this point in the history
Co-authored-by: yvanpeng <[email protected]>
  • Loading branch information
yuanyuan100 and yvanpeng authored May 23, 2024
1 parent 1cbaebf commit 0d2187a
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,9 @@ -(NSString *)description{
NSString * const kMacBookAir_15_12 = @"Mac15,12";
NSString * const kMacBookAir_14_15 = @"Mac14,15";
NSString * const kMacBookAir_14_2 = @"Mac14,2";
NSString * const kMacBookAir_early_10_1 = @"MacBookAir10,1";

// 非刘海屏,但是model是Macxx,xx
NSString * const kMacBookPro_14_7 = @"Mac14,7";

@implementation MachineModel (LHScreen)

Expand All @@ -487,7 +489,7 @@ + (BOOL)isLiquidScreen {
+ (BOOL)__isLiquidScreen {
BOOL isLiquid = NO;
MachineModel *model = [[MachineModel alloc] init];
NSString *machineName = model.machineName ? : @"Unknown Mac";
NSString *machineName = model.machineName ? : @"Unknown Mac";
NSArray *list = @[
kMacBookPro_15_3,
kMacBookPro_15_6,
Expand All @@ -507,8 +509,7 @@ + (BOOL)__isLiquidScreen {
kMacBookAir_15_13,
kMacBookAir_15_12,
kMacBookAir_14_15,
kMacBookAir_14_2,
kMacBookAir_early_10_1
kMacBookAir_14_2
];
if ([list containsObject:machineName]) {
isLiquid = YES;
Expand All @@ -522,6 +523,8 @@ + (BOOL)__isLiquidScreen {
isLiquid = NO;
} else if ([machineName containsString:@"MacBookPro"]) {
isLiquid = NO;
} else if ([machineName isEqualToString:kMacBookPro_14_7]) {
isLiquid = NO;
} else if ([self __assertRegex:@"Mac(\\d{1,2}),(\\d{1,2})" matchStr:machineName]) {
// 有电池则是笔记本,否则为iMac、Mac Mini、Mac Pro、Mac studio
BatteryModel *batteryModel = [[BatteryModel alloc] init];
Expand Down

0 comments on commit 0d2187a

Please sign in to comment.