2
This commit is contained in:
@@ -30,6 +30,8 @@
|
||||
|
||||
// 以 375 宽设计稿为基准的键盘总高度
|
||||
static const CGFloat kKBKeyboardBaseHeight = 250.0f;
|
||||
static NSString * const kKBDefaultSkinId = @"normal_them";
|
||||
static NSString * const kKBDefaultSkinZipName = @"normal_them";
|
||||
|
||||
static void KBSkinInstallNotificationCallback(CFNotificationCenterRef center,
|
||||
void *observer,
|
||||
@@ -97,6 +99,7 @@ static void KBSkinInstallNotificationCallback(CFNotificationCenterRef center,
|
||||
NULL,
|
||||
CFNotificationSuspensionBehaviorDeliverImmediately);
|
||||
[self kb_consumePendingShopSkin];
|
||||
[self kb_applyDefaultSkinIfNeeded];
|
||||
|
||||
}
|
||||
|
||||
@@ -763,6 +766,38 @@ static void KBSkinInstallNotificationCallback(CFNotificationCenterRef center,
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - Default Skin
|
||||
|
||||
- (void)kb_applyDefaultSkinIfNeeded {
|
||||
NSDictionary *pending = [KBSkinInstallBridge pendingRequestPayload];
|
||||
if (pending.count > 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
NSString *currentId = [KBSkinManager shared].current.skinId ?: @"";
|
||||
BOOL isDefault = (currentId.length == 0 || [currentId isEqualToString:@"default"]);
|
||||
if (!isDefault && ![currentId isEqualToString:kKBDefaultSkinId]) {
|
||||
return;
|
||||
}
|
||||
if ([currentId isEqualToString:kKBDefaultSkinId]) {
|
||||
return;
|
||||
}
|
||||
|
||||
NSError *applyError = nil;
|
||||
if ([KBSkinInstallBridge applyInstalledSkinWithId:kKBDefaultSkinId error:&applyError]) {
|
||||
return;
|
||||
}
|
||||
|
||||
[KBSkinInstallBridge publishBundleSkinRequestWithId:kKBDefaultSkinId
|
||||
name:kKBDefaultSkinId
|
||||
zipName:kKBDefaultSkinZipName
|
||||
iconShortNames:nil];
|
||||
[KBSkinInstallBridge consumePendingRequestFromBundle:NSBundle.mainBundle
|
||||
completion:^(__unused BOOL success, __unused NSError * _Nullable error) {
|
||||
// 已通过通知触发主题刷新,这里无需额外处理
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - Layout Helpers
|
||||
|
||||
- (CGFloat)kb_portraitWidth {
|
||||
|
||||
Reference in New Issue
Block a user