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

@@ -176,7 +176,16 @@
- (void)reloadDemoData {
//
self.itemsInternal = @[@"高情商", @"暖味拉扯", @"风趣幽默", @"撩女生", @"社交惬匿", @"情场高手", @"一枚暖男", @"聊天搭子", @"表达爱意", @"更多话术"];
self.itemsInternal = @[KBLocalized(@"高情商"),
KBLocalized(@"暖味拉扯"),
KBLocalized(@"风趣幽默"),
KBLocalized(@"撩女生"),
KBLocalized(@"社交惬匿"),
KBLocalized(@"情场高手"),
KBLocalized(@"一枚暖男"),
KBLocalized(@"聊天搭子"),
KBLocalized(@"表达爱意"),
KBLocalized(@"更多话术")];
[self.tagListView setItems:self.itemsInternal];
}
@@ -257,7 +266,7 @@ static NSString * const kKBStreamDemoURL = @"http://192.168.1.144:7529/api/demo/
[self.tagListView setLoading:NO atIndex:self.loadingTagIndex.integerValue];
self.loadingTagIndex = nil; self.loadingTagTitle = nil;
}
if (error) { [KBHUD showInfo:@"拉取失败"]; }
if (error) { [KBHUD showInfo:KBLocalized(@"拉取失败")]; }
if (self.streamOverlay) { [self.streamOverlay finish]; }
};
self.streamFetcher = fetcher;
@@ -296,7 +305,7 @@ static NSString * const kKBStreamDemoURL = @"http://192.168.1.144:7529/api/demo/
// 1) 访
if (![[KBFullAccessManager shared] hasFullAccess]) {
// 访
[KBHUD showInfo:@"处理中…"];
[KBHUD showInfo:KBLocalized(@"处理中…")];
[[KBFullAccessManager shared] ensureFullAccessOrGuideInView:self];
return;
}
@@ -330,7 +339,7 @@ static NSString * const kKBStreamDemoURL = @"http://192.168.1.144:7529/api/demo/
#pragma clang diagnostic pop
} @catch (__unused NSException *e) { bridged = NO; }
if (!bridged) {
[KBHUD showInfo:@"请切换到主App完成登录"];
[KBHUD showInfo:KBLocalized(@"请切换到主App完成登录")];
}
}];
});
@@ -362,7 +371,7 @@ static void KBULDarwinCallback(CFNotificationCenterRef center, void *observer, C
return;
}
[KBHUD showInfo:@"处理中…"];
[KBHUD showInfo:KBLocalized(@"处理中…")];
UIInputViewController *ivc = KBFindInputViewController(self);
if (!ivc) return;
@@ -482,13 +491,13 @@ static void KBULDarwinCallback(CFNotificationCenterRef center, void *observer, C
- (void)kb_fullAccessChanged {
dispatch_async(dispatch_get_main_queue(), ^{ [self kb_refreshPasteboardMonitor]; });
}
- (void)onTapDelete {
- (void)onTapDelete {
NSLog(@"点击:删除");
UIInputViewController *ivc = KBFindInputViewController(self);
id<UITextDocumentProxy> proxy = ivc.textDocumentProxy;
[proxy deleteBackward];
}
- (void)onTapClear {
- (void)onTapClear {
NSLog(@"点击:清空");
// pasteView
UIInputViewController *ivc = KBFindInputViewController(self);
@@ -505,7 +514,7 @@ static void KBULDarwinCallback(CFNotificationCenterRef center, void *observer, C
guard += count;
}
}
- (void)onTapSend {
- (void)onTapSend {
NSLog(@"点击:发送");
// App
UIInputViewController *ivc = KBFindInputViewController(self);
@@ -572,7 +581,7 @@ static void KBULDarwinCallback(CFNotificationCenterRef center, void *observer, C
- (UIButton *)pasteButtonInternal {
if (!_pasteButtonInternal) {
_pasteButtonInternal = [self buildRightButtonWithTitle:@"粘贴" color:[UIColor colorWithRed:0.13 green:0.73 blue:0.60 alpha:1.0]];
_pasteButtonInternal = [self buildRightButtonWithTitle:KBLocalized(@"Paste") color:[UIColor colorWithRed:0.13 green:0.73 blue:0.60 alpha:1.0]];
[_pasteButtonInternal addTarget:self action:@selector(onTapPaste) forControlEvents:UIControlEventTouchUpInside];
}
return _pasteButtonInternal;
@@ -586,7 +595,7 @@ static void KBULDarwinCallback(CFNotificationCenterRef center, void *observer, C
_deleteButtonInternal.layer.cornerRadius = 12.0;
_deleteButtonInternal.layer.masksToBounds = YES;
_deleteButtonInternal.titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightSemibold];
[_deleteButtonInternal setTitle:@"删除" forState:UIControlStateNormal];
[_deleteButtonInternal setTitle:KBLocalized(@"删除") forState:UIControlStateNormal];
[_deleteButtonInternal setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
[_deleteButtonInternal addTarget:self action:@selector(onTapDelete) forControlEvents:UIControlEventTouchUpInside];
}
@@ -600,16 +609,16 @@ static void KBULDarwinCallback(CFNotificationCenterRef center, void *observer, C
_clearButtonInternal.layer.cornerRadius = 12.0;
_clearButtonInternal.layer.masksToBounds = YES;
_clearButtonInternal.titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightSemibold];
[_clearButtonInternal setTitle:@"清空" forState:UIControlStateNormal];
[_clearButtonInternal setTitle:KBLocalized(@"Clear") forState:UIControlStateNormal];
[_clearButtonInternal setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
[_clearButtonInternal addTarget:self action:@selector(onTapClear) forControlEvents:UIControlEventTouchUpInside];
}
return _clearButtonInternal;
}
- (UIButton *)sendButtonInternal {
- (UIButton *)sendButtonInternal {
if (!_sendButtonInternal) {
_sendButtonInternal = [self buildRightButtonWithTitle:@"发送" color:[UIColor colorWithRed:0.13 green:0.73 blue:0.60 alpha:1.0]];
_sendButtonInternal = [self buildRightButtonWithTitle:KBLocalized(@"Send") color:[UIColor colorWithRed:0.13 green:0.73 blue:0.60 alpha:1.0]];
[_sendButtonInternal addTarget:self action:@selector(onTapSend) forControlEvents:UIControlEventTouchUpInside];
}
return _sendButtonInternal;