This commit is contained in:
2025-11-25 16:53:38 +08:00
parent b660eb19f4
commit c4398a689b
4 changed files with 61 additions and 107 deletions

Binary file not shown.

View File

@@ -52,6 +52,7 @@
04791F952ED48028004E8522 /* KBFeedBackVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 04791F942ED48028004E8522 /* KBFeedBackVC.m */; };
04791F982ED49CE7004E8522 /* KBFont.m in Sources */ = {isa = PBXBuildFile; fileRef = 04791F972ED49CE7004E8522 /* KBFont.m */; };
04791F992ED49CE7004E8522 /* KBFont.m in Sources */ = {isa = PBXBuildFile; fileRef = 04791F972ED49CE7004E8522 /* KBFont.m */; };
04791FF52ED5A487004E8522 /* Christmas.zip in Resources */ = {isa = PBXBuildFile; fileRef = 04791FF42ED5A487004E8522 /* Christmas.zip */; };
047C650D2EBC8A840035E841 /* KBPanModalView.m in Sources */ = {isa = PBXBuildFile; fileRef = 047C650C2EBC8A840035E841 /* KBPanModalView.m */; };
047C65102EBCA8DD0035E841 /* HomeRankContentVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 047C650F2EBCA8DD0035E841 /* HomeRankContentVC.m */; };
047C65502EBCBA9E0035E841 /* KBShopVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 047C654F2EBCBA9E0035E841 /* KBShopVC.m */; };
@@ -262,6 +263,7 @@
04791F942ED48028004E8522 /* KBFeedBackVC.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KBFeedBackVC.m; sourceTree = "<group>"; };
04791F962ED49CE7004E8522 /* KBFont.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KBFont.h; sourceTree = "<group>"; };
04791F972ED49CE7004E8522 /* KBFont.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KBFont.m; sourceTree = "<group>"; };
04791FF42ED5A487004E8522 /* Christmas.zip */ = {isa = PBXFileReference; lastKnownFileType = archive.zip; path = Christmas.zip; sourceTree = "<group>"; };
047C650B2EBC8A840035E841 /* KBPanModalView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KBPanModalView.h; sourceTree = "<group>"; };
047C650C2EBC8A840035E841 /* KBPanModalView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KBPanModalView.m; sourceTree = "<group>"; };
047C650E2EBCA8DD0035E841 /* HomeRankContentVC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HomeRankContentVC.h; sourceTree = "<group>"; };
@@ -499,6 +501,7 @@
041007D12ECE012000D203BB /* KBSkinIconMap.strings */,
041007D32ECE012500D203BB /* 002.zip */,
046131102ECF3A6E00A6FADF /* fense.zip */,
04791FF42ED5A487004E8522 /* Christmas.zip */,
);
path = Resource;
sourceTree = "<group>";
@@ -1450,6 +1453,7 @@
046131112ECF3A6E00A6FADF /* fense.zip in Resources */,
041007D42ECE012500D203BB /* 002.zip in Resources */,
041007D22ECE012000D203BB /* KBSkinIconMap.strings in Resources */,
04791FF52ED5A487004E8522 /* Christmas.zip in Resources */,
04286A0B2ECD88B400CE730C /* KeyboardAssets.xcassets in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;

View File

@@ -9,6 +9,7 @@
#import "KBHUD.h"
#import "KBConfig.h"
#import "KBSkinService.h"
#import "KBSkinInstallBridge.h"
@interface KBSkinCell : UITableViewCell
@property (nonatomic, strong) UIButton *applyBtn;
@@ -46,110 +47,12 @@
[super viewDidLoad];
// self.title = KBLocalized(@"皮肤中心");
self.view.backgroundColor = [UIColor whiteColor];
// JSON
//
// - background_image URL使 picsum
// - background/key_bg/key_text/key_highlight/accent KBSkinManager.applyThemeFromJSON
// - hidden_keys identifier
// - key_icons
// * KB_SKIN_ICON_USE_REMOTE==0 value Assets "kb_space_melon"
// * KB_SKIN_ICON_USE_REMOTE==1 value Zip "key_space" Skins/<skinId>/icons/key_space.png
// self.skins = @[
// @{
// @"id": @"melon",
// @"name": KBLocalized(@"蜜瓜主题"),
// @"background_image": @"https://picsum.photos/id/1018/800/450.jpg",
// @"background": @"#F5FFE8",
// @"key_bg": @"#FFFFFF",
// @"key_text": @"#4A4A4A",
// @"key_highlight": @"#D9F4C4",
// @"accent": @"#A4D68A",
// @"hidden_keys": @[
// @"letter_q",@"letter_w",@"letter_e",@"letter_r",@"letter_t",
// @"letter_y",@"letter_u",@"letter_i",@"letter_o",@"letter_p",
// @"letter_a",@"letter_s",@"letter_d",@"letter_f",@"letter_g",
// @"letter_h",@"letter_j",@"letter_k",@"letter_l",
// @"letter_z",@"letter_x",@"letter_c",@"letter_v",
// @"letter_b",@"letter_n",@"letter_m",
// @"space"
// ],
// // Assets
// // Zip Zip "key_space"
// @"key_icons": @{
// //
// // *_lower / *_upper
// @"letter_q_lower": @"key_q",
// @"letter_q_upper": @"key_q",
// @"letter_w_lower": @"key_w",
// @"letter_w_upper": @"key_w",
// @"letter_e_lower": @"key_e",
// @"letter_e_upper": @"key_e",
// @"letter_r_lower": @"key_r",
// @"letter_r_upper": @"key_r",
// @"letter_t_lower": @"key_t",
// @"letter_t_upper": @"key_t",
// @"letter_y_lower": @"key_y",
// @"letter_y_upper": @"key_y",
// @"letter_u_lower": @"key_u",
// @"letter_u_upper": @"key_u",
// @"letter_i_lower": @"key_i",
// @"letter_i_upper": @"key_i",
// @"letter_o_lower": @"key_o",
// @"letter_o_upper": @"key_o",
// @"letter_p_lower": @"key_p",
// @"letter_p_upper": @"key_p",
//
// @"letter_a_lower": @"key_a",
// @"letter_a_upper": @"key_a",
// @"letter_s_lower": @"key_s",
// @"letter_s_upper": @"key_s",
// @"letter_d_lower": @"key_d",
// @"letter_d_upper": @"key_d",
// @"letter_f_lower": @"key_f",
// @"letter_f_upper": @"key_f",
// @"letter_g_lower": @"key_g",
// @"letter_g_upper": @"key_g",
// @"letter_h_lower": @"key_h",
// @"letter_h_upper": @"key_h",
// @"letter_j_lower": @"key_j",
// @"letter_j_upper": @"key_j",
// @"letter_k_lower": @"key_k",
// @"letter_k_upper": @"key_k",
// @"letter_l_lower": @"key_l",
// @"letter_l_upper": @"key_l",
//
// @"letter_z_lower": @"key_z",
// @"letter_z_upper": @"key_z",
// @"letter_x_lower": @"key_x",
// @"letter_x_upper": @"key_x",
// @"letter_c_lower": @"key_c",
// @"letter_c_upper": @"key_c",
// @"letter_v_lower": @"key_v",
// @"letter_v_upper": @"key_v",
// @"letter_b_lower": @"key_b",
// @"letter_b_upper": @"key_b",
// @"letter_n_lower": @"key_n",
// @"letter_n_upper": @"key_n",
// @"letter_m_lower": @"key_m",
// @"letter_m_upper": @"key_m",
//
// //
// @"space": @"key_space", //
// @"backspace": @"key_del", //
// @"shift": @"key_up", // Shift
// @"mode_123": @"key_123", // "123"
// @"ai": @"key_ai", // AI
// @"return": @"key_send" // /
// }
// }
// ];
self.skins = @[
@{
@"id": @"local001",
@"name": KBLocalized(@"本地001皮肤"),
@"id": @"local002",
@"name": KBLocalized(@"本地002皮肤"),
// zip_url bundle:// +
@"zip_url": @"bundle://001.zip",
@"zip_url": @"bundle://002.zip",
// 便
@"background": @"#F5FFE8",
@@ -158,7 +61,35 @@
@"key_highlight": @"#D9F4C4",
@"accent": @"#A4D68A"
// key_icons
}
},
@{
@"id": @"remote002",
@"name": KBLocalized(@"远程皮肤"),
// zip_url bundle:// +
@"zip_url": @"",
// // 便
// @"background": @"#F5FFE8",
// @"key_bg": @"#FFFFFF",
// @"key_text": @"#4A4A4A",
// @"key_highlight": @"#D9F4C4",
// @"accent": @"#A4D68A"
// key_icons
},
@{
@"id": @"圣诞001",
@"name": KBLocalized(@"本地圣诞皮肤"),
// zip_url bundle:// +
@"zip_url": @"bundle://Christmas.zip",
// 便
@"background": @"#F5FFE8",
@"key_bg": @"#FFFFFF",
@"key_text": @"#4A4A4A",
@"key_highlight": @"#D9F4C4",
@"accent": @"#A4D68A"
// key_icons
},
];
self.tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, KB_NAV_TOTAL_HEIGHT, KB_SCREEN_WIDTH, KB_SCREEN_HEIGHT - KB_NAV_TOTAL_HEIGHT) style:UITableViewStyleInsetGrouped];
@@ -213,10 +144,29 @@
if (idx < 0 || idx >= self.skins.count) return;
NSDictionary *skin = self.skins[idx];
if (!skin) return;
[[KBSkinService shared] applySkinWithJSON:skin
fromViewController:self
mode:KBSkinSourceModeLocalBundleZip
completion:nil];
if (idx == 0) {
[[KBSkinService shared] applySkinWithJSON:skin
fromViewController:self
mode:KBSkinSourceModeLocalBundleZip
completion:nil];
}else if (idx == 1){
[[KBSkinService shared] applySkinWithJSON:skin
fromViewController:self
mode:KBSkinSourceModeRemoteZip
completion:nil];
}else if (idx == 2){
// [[KBSkinService shared] applySkinWithJSON:skin
// fromViewController:self
// mode:KBSkinSourceModeLocalBundleZip
// completion:nil];
static NSString * const kKBBundleSkinId002 = @"bundle_Christmas";
[KBSkinInstallBridge publishBundleSkinRequestWithId:kKBBundleSkinId002
name:@"" ?: kKBBundleSkinId002
zipName:@"Christmas.zip"
iconShortNames:nil];
[KBHUD showInfo:KBLocalized(@"已通知键盘解压,切换到自定义键盘即可生效")];
}
}
- (void)onResetDefault:(UIButton *)sender {

View File

@@ -62,7 +62,7 @@
// bundle zip_url bundle zip
[self kb_applySkinUsingLocalBundle:skinJSON completion:completion];
break;
case KBSkinSourceModeRemoteZip:
// case KBSkinSourceModeRemoteZip:
default:
// zip_url http/https
[self kb_applySkinUsingRemoteIcons:skinJSON completion:completion];