2
This commit is contained in:
@@ -51,7 +51,7 @@
|
||||
del.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.35];
|
||||
del.layer.cornerRadius = 14; del.layer.masksToBounds = YES;
|
||||
del.titleLabel.font = [UIFont systemFontOfSize:13 weight:UIFontWeightSemibold];
|
||||
[del setTitle:@"删除" forState:UIControlStateNormal];
|
||||
[del setTitle:KBLocalized(@"Delete") forState:UIControlStateNormal];
|
||||
[del setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
||||
[del addTarget:self action:@selector(onTapClose) forControlEvents:UIControlEventTouchUpInside];
|
||||
_closeButton = del;
|
||||
@@ -77,4 +77,3 @@
|
||||
- (KBStreamTextView *)textView { return self.textViewInternal; }
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
}];
|
||||
|
||||
UILabel *title = [UILabel new];
|
||||
title.text = @"开启【允许完全访问】,体验完整功能";
|
||||
title.text = KBLocalized(@"Turn on Allow Full Access to experience all features");
|
||||
title.font = [UIFont boldSystemFontOfSize:16];
|
||||
title.textColor = [UIColor blackColor];
|
||||
title.textAlignment = NSTextAlignmentCenter;
|
||||
@@ -70,7 +70,7 @@
|
||||
}];
|
||||
|
||||
UILabel *row1 = [UILabel new]; row1.text = AppName; row1.textColor = [UIColor blackColor];
|
||||
UILabel *row2 = [UILabel new]; row2.text = @"允许完全访问"; row2.textColor = [UIColor blackColor];
|
||||
UILabel *row2 = [UILabel new]; row2.text = KBLocalized(@"Allow Full Access"); row2.textColor = [UIColor blackColor];
|
||||
[box addSubview:row1]; [box addSubview:row2];
|
||||
[row1 mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(box).offset(16); make.top.equalTo(box).offset(14); }];
|
||||
UIView *line = [UIView new]; line.backgroundColor = [UIColor colorWithWhite:0.9 alpha:1.0];
|
||||
@@ -98,7 +98,7 @@
|
||||
|
||||
UIButton *go = [UIButton buttonWithType:UIButtonTypeSystem];
|
||||
go.backgroundColor = [UIColor blackColor];
|
||||
[go setTitle:@"去开启" forState:UIControlStateNormal];
|
||||
[go setTitle:KBLocalized(@"Go enable") forState:UIControlStateNormal];
|
||||
[go setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
||||
go.titleLabel.font = [UIFont boldSystemFontOfSize:18];
|
||||
go.layer.cornerRadius = 12;
|
||||
@@ -168,10 +168,10 @@
|
||||
// Universal Link(需 AASA/Associated Domains 配置且 KB_UL_BASE 与域名一致)
|
||||
NSURL *ul = [NSURL URLWithString:[NSString stringWithFormat:@"%@?src=kb_extension", KB_UL_SETTINGS]];
|
||||
|
||||
void (^finish)(BOOL) = ^(BOOL ok){
|
||||
void (^finish)(BOOL) = ^(BOOL ok){
|
||||
if (ok) { [self dismiss]; }
|
||||
else {
|
||||
NSString *showInfo = [NSString stringWithFormat:@"请按路径:设置→通用→键盘→键盘→%@→允许完全访问",AppName];
|
||||
NSString *showInfo = [NSString stringWithFormat:KBLocalized(@"Follow: Settings → General → Keyboard → Keyboards → %@ → Allow Full Access"),AppName];
|
||||
[KBHUD showInfo:showInfo];
|
||||
}
|
||||
};
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
- (UILabel *)placeholderLabelInternal {
|
||||
if (!_placeholderLabelInternal) {
|
||||
_placeholderLabelInternal = [[UILabel alloc] init];
|
||||
_placeholderLabelInternal.text = @"点击粘贴TA的话";
|
||||
_placeholderLabelInternal.text = KBLocalized(@"Tap to paste their message");
|
||||
_placeholderLabelInternal.textColor = [UIColor colorWithRed:0.20 green:0.64 blue:0.54 alpha:1.0];
|
||||
_placeholderLabelInternal.font = [UIFont systemFontOfSize:16 weight:UIFontWeightMedium];
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -125,7 +125,7 @@
|
||||
NSArray *r4 = @[ [KBKey keyWithTitle:@"abc" type:KBKeyTypeModeChange],
|
||||
[KBKey keyWithTitle:@"AI" type:KBKeyTypeCustom],
|
||||
[KBKey keyWithTitle:@"space" type:KBKeyTypeSpace],
|
||||
[KBKey keyWithTitle:@"发送" type:KBKeyTypeReturn] ];
|
||||
[KBKey keyWithTitle:KBLocalized(@"Send") type:KBKeyTypeReturn] ];
|
||||
|
||||
return @[r1, r2, r3, r4];
|
||||
}
|
||||
@@ -159,7 +159,7 @@
|
||||
NSArray *row4 = @[ [KBKey keyWithTitle:@"123" type:KBKeyTypeModeChange],
|
||||
[KBKey keyWithTitle:@"AI" type:KBKeyTypeCustom],
|
||||
[KBKey keyWithTitle:@"space" type:KBKeyTypeSpace],
|
||||
[KBKey keyWithTitle:@"发送" type:KBKeyTypeReturn] ];
|
||||
[KBKey keyWithTitle:KBLocalized(@"Send") type:KBKeyTypeReturn] ];
|
||||
|
||||
return @[row1.copy, row2.copy, row3.copy, row4];
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
}];
|
||||
|
||||
self.titleLabel = [[UILabel alloc] init];
|
||||
self.titleLabel.text = @"设置";
|
||||
self.titleLabel.text = KBLocalized(@"设置");
|
||||
self.titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightSemibold];
|
||||
self.titleLabel.textColor = [UIColor blackColor];
|
||||
[self addSubview:self.titleLabel];
|
||||
@@ -37,7 +37,7 @@
|
||||
|
||||
// 占位内容
|
||||
UILabel *place = [[UILabel alloc] init];
|
||||
place.text = @"这里是设置内容占位";
|
||||
place.text = KBLocalized(@"这里是设置内容占位");
|
||||
place.textColor = [UIColor darkGrayColor];
|
||||
place.font = [UIFont systemFontOfSize:14];
|
||||
[self addSubview:place];
|
||||
@@ -68,4 +68,3 @@
|
||||
- (UIButton *)backButton { return self.backButtonInternal; }
|
||||
|
||||
@end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user