删除立即充值按钮

This commit is contained in:
2025-12-19 21:36:11 +08:00
parent 2cacaab974
commit d612346db5
3 changed files with 7 additions and 11 deletions

View File

@@ -277,10 +277,6 @@ static void KBSkinInstallNotificationCallback(CFNotificationCenterRef center,
- (void)keyBoardMainView:(KBKeyBoardMainView *)keyBoardMainView didTapToolActionAtIndex:(NSInteger)index { - (void)keyBoardMainView:(KBKeyBoardMainView *)keyBoardMainView didTapToolActionAtIndex:(NSInteger)index {
if (index == 0) { if (index == 0) {
[self showSubscriptionPanel];
return;
}
if (index == 1) {
[self showFunctionPanel:YES]; [self showFunctionPanel:YES];
return; return;
} }

View File

@@ -26,7 +26,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, weak, nullable) id<KBToolBarDelegate> delegate; @property (nonatomic, weak, nullable) id<KBToolBarDelegate> delegate;
/// 左侧按钮的标题(数量由数组决定)。默认值:@[@"Recharge Now", @"AI"]。 /// 左侧按钮的标题(数量由数组决定)。默认值:@[@"AI"]。
@property (nonatomic, copy) NSArray<NSString *> *leftButtonTitles; @property (nonatomic, copy) NSArray<NSString *> *leftButtonTitles;
/// 暴露按钮以便外部定制(只读;首次访问时懒加载创建) /// 暴露按钮以便外部定制(只读;首次访问时懒加载创建)

View File

@@ -29,7 +29,7 @@ static const CGFloat kKBAIButtonHeight = 36.0f;
- (instancetype)initWithFrame:(CGRect)frame{ - (instancetype)initWithFrame:(CGRect)frame{
if (self = [super initWithFrame:frame]) { if (self = [super initWithFrame:frame]) {
self.backgroundColor = [UIColor clearColor]; self.backgroundColor = [UIColor clearColor];
_leftButtonTitles = @[KBLocalized(@"Recharge Now"), @"AI"]; // _leftButtonTitles = @[@"AI"]; //
[self setupUI]; [self setupUI];
[[NSNotificationCenter defaultCenter] addObserver:self [[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(kb_undoStateChanged) selector:@selector(kb_undoStateChanged)
@@ -109,7 +109,7 @@ static const CGFloat kKBAIButtonHeight = 36.0f;
[buttons addObject:btn]; [buttons addObject:btn];
[btn mas_makeConstraints:^(MASConstraintMaker *make) { [btn mas_makeConstraints:^(MASConstraintMaker *make) {
if (i == 1) { if (i == 0) {
make.centerY.equalTo(self.leftContainer); make.centerY.equalTo(self.leftContainer);
make.width.mas_equalTo(kKBAIButtonWidth); make.width.mas_equalTo(kKBAIButtonWidth);
make.height.mas_equalTo(kKBAIButtonHeight); make.height.mas_equalTo(kKBAIButtonHeight);
@@ -196,7 +196,7 @@ static const CGFloat kKBAIButtonHeight = 36.0f;
[aiButton setBackgroundImage:nil forState:UIControlStateNormal]; [aiButton setBackgroundImage:nil forState:UIControlStateNormal];
[aiButton setBackgroundImage:nil forState:UIControlStateHighlighted]; [aiButton setBackgroundImage:nil forState:UIControlStateHighlighted];
[aiButton setBackgroundImage:nil forState:UIControlStateSelected]; [aiButton setBackgroundImage:nil forState:UIControlStateSelected];
NSString *title = (self.leftButtonTitles.count > 1) ? self.leftButtonTitles[1] : @"AI"; NSString *title = (self.leftButtonTitles.count > 0) ? self.leftButtonTitles[0] : @"AI";
[aiButton setTitle:title forState:UIControlStateNormal]; [aiButton setTitle:title forState:UIControlStateNormal];
aiButton.backgroundColor = [UIColor colorWithWhite:1 alpha:0.9]; aiButton.backgroundColor = [UIColor colorWithWhite:1 alpha:0.9];
aiButton.layer.cornerRadius = 16; aiButton.layer.cornerRadius = 16;
@@ -278,8 +278,8 @@ static const CGFloat kKBAIButtonHeight = 36.0f;
} }
- (UIButton *)kb_aiButton { - (UIButton *)kb_aiButton {
if (self.leftButtonsInternal.count <= 1) { return nil; } if (self.leftButtonsInternal.count == 0) { return nil; }
return self.leftButtonsInternal[1]; return self.leftButtonsInternal[0];
} }
#pragma mark - Globe (Input Mode Switch) #pragma mark - Globe (Input Mode Switch)
@@ -324,7 +324,7 @@ static const CGFloat kKBAIButtonHeight = 36.0f;
make.right.equalTo(self).offset(-12); make.right.equalTo(self).offset(-12);
} }
make.centerY.equalTo(self.mas_centerY); make.centerY.equalTo(self.mas_centerY);
make.height.mas_equalTo(32); make.height.mas_equalTo(MAX(32.0f, kKBAIButtonHeight));
}]; }];
} }