This commit is contained in:
2025-11-17 20:07:39 +08:00
parent ee433db4ad
commit 005e3c7581
43 changed files with 529 additions and 172 deletions

View File

@@ -17,7 +17,7 @@
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
self.selectionStyle = UITableViewCellSelectionStyleNone;
_applyBtn = [UIButton buttonWithType:UIButtonTypeSystem];
[_applyBtn setTitle:@"下载并应用" forState:UIControlStateNormal];
[_applyBtn setTitle:KBLocalized(@"Download & Apply") forState:UIControlStateNormal];
_applyBtn.layer.cornerRadius = 6; _applyBtn.layer.borderWidth = 1;
_applyBtn.layer.borderColor = [UIColor colorWithWhite:0.85 alpha:1].CGColor;
[self.contentView addSubview:_applyBtn];
@@ -41,14 +41,14 @@
- (void)viewDidLoad {
[super viewDidLoad];
self.title = @"皮肤中心";
self.title = KBLocalized(@"皮肤中心");
self.view.backgroundColor = [UIColor whiteColor];
// URL KB_BASE_URL
// 使 picsum.photos id访
self.skins = @[
@{ @"id": @"aurora", @"name": @"极光", @"img": @"https://picsum.photos/id/1018/1600/900.jpg" },
@{ @"id": @"alps", @"name": @"雪山", @"img": @"https://picsum.photos/id/1016/1600/900.jpg" },
@{ @"id": @"lake", @"name": @"湖面", @"img": @"https://picsum.photos/id/1039/1600/900.jpg" },
@{ @"id": @"aurora", @"name": KBLocalized(@"极光"), @"img": @"https://picsum.photos/id/1018/1600/900.jpg" },
@{ @"id": @"alps", @"name": KBLocalized(@"雪山"), @"img": @"https://picsum.photos/id/1016/1600/900.jpg" },
@{ @"id": @"lake", @"name": KBLocalized(@"湖面"), @"img": @"https://picsum.photos/id/1039/1600/900.jpg" },
];
self.tableView = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStyleInsetGrouped];
@@ -124,7 +124,7 @@
payload = UIImageJPEGRepresentation(img, 0.9);
}
BOOL ok = (payload.length > 0) ? [[KBSkinManager shared] applyImageSkinWithData:payload skinId:skin[@"id"] name:skin[@"name"]] : NO;
[KBHUD showInfo:(ok ? @"已应用,切到键盘查看" : @"应用失败")];
[KBHUD showInfo:(ok ? KBLocalized(@"已应用,切到键盘查看") : KBLocalized(@"应用失败"))];
});
}];
}