添加键盘功能viewUI改动
This commit is contained in:
22
CustomKeyboard/KeyboardAssets.xcassets/kb_del_icon.imageset/Contents.json
vendored
Normal file
22
CustomKeyboard/KeyboardAssets.xcassets/kb_del_icon.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"filename" : "kb_del_icon@2x.png",
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"filename" : "kb_del_icon@3x.png",
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "3x"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"author" : "xcode",
|
||||||
|
"version" : 1
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
CustomKeyboard/KeyboardAssets.xcassets/kb_del_icon.imageset/kb_del_icon@2x.png
vendored
Normal file
BIN
CustomKeyboard/KeyboardAssets.xcassets/kb_del_icon.imageset/kb_del_icon@2x.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
BIN
CustomKeyboard/KeyboardAssets.xcassets/kb_del_icon.imageset/kb_del_icon@3x.png
vendored
Normal file
BIN
CustomKeyboard/KeyboardAssets.xcassets/kb_del_icon.imageset/kb_del_icon@3x.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.0 KiB |
22
CustomKeyboard/KeyboardAssets.xcassets/kb_zt_icon.imageset/Contents.json
vendored
Normal file
22
CustomKeyboard/KeyboardAssets.xcassets/kb_zt_icon.imageset/Contents.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"filename" : "kb_zt_icon@2x.png",
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"filename" : "kb_zt_icon@3x.png",
|
||||||
|
"idiom" : "universal",
|
||||||
|
"scale" : "3x"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"author" : "xcode",
|
||||||
|
"version" : 1
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
CustomKeyboard/KeyboardAssets.xcassets/kb_zt_icon.imageset/kb_zt_icon@2x.png
vendored
Normal file
BIN
CustomKeyboard/KeyboardAssets.xcassets/kb_zt_icon.imageset/kb_zt_icon@2x.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1014 B |
BIN
CustomKeyboard/KeyboardAssets.xcassets/kb_zt_icon.imageset/kb_zt_icon@3x.png
vendored
Normal file
BIN
CustomKeyboard/KeyboardAssets.xcassets/kb_zt_icon.imageset/kb_zt_icon@3x.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.8 KiB |
@@ -246,6 +246,21 @@ static void KBSkinInstallNotificationCallback(CFNotificationCenterRef center,
|
|||||||
[self showFunctionPanel:NO];
|
[self showFunctionPanel:NO];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
- (void)functionView:(KBFunctionView *_Nullable)functionView didRightTapToolActionAtIndex:(NSInteger)index{
|
||||||
|
NSString *schemeStr = [NSString stringWithFormat:@"%@://recharge?src=keyboard", KB_APP_SCHEME];
|
||||||
|
NSURL *scheme = [NSURL URLWithString:schemeStr];
|
||||||
|
//
|
||||||
|
// if (!ul && !scheme) { return; }
|
||||||
|
//
|
||||||
|
// 从当前视图作为起点,通过响应链找到 UIApplication 再调起主 App
|
||||||
|
BOOL ok = [KBHostAppLauncher openHostAppURL:scheme fromResponder:self.view];
|
||||||
|
|
||||||
|
if (!ok) {
|
||||||
|
// 失败兜底:给个文案提示
|
||||||
|
// 比如:请回到桌面手动打开 XXX App 进行设置/充值
|
||||||
|
[KBHUD showInfo:@"请回到桌面手动打开App进行充值"];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#pragma mark - lazy
|
#pragma mark - lazy
|
||||||
- (KBKeyBoardMainView *)keyBoardMainView{
|
- (KBKeyBoardMainView *)keyBoardMainView{
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
#import "KBFunctionTagCell.h"
|
#import "KBFunctionTagCell.h"
|
||||||
|
|
||||||
static NSString * const kKBFunctionTagCellId2 = @"KBFunctionTagCellId2";
|
static NSString * const kKBFunctionTagCellId2 = @"KBFunctionTagCellId2";
|
||||||
|
static CGFloat const kKBItemSpace = 4;
|
||||||
|
|
||||||
@interface KBFunctionTagListView () <UICollectionViewDataSource, UICollectionViewDelegateFlowLayout>
|
@interface KBFunctionTagListView () <UICollectionViewDataSource, UICollectionViewDelegateFlowLayout>
|
||||||
@property (nonatomic, strong) UICollectionView *collectionViewInternal;
|
@property (nonatomic, strong) UICollectionView *collectionViewInternal;
|
||||||
@@ -54,13 +55,13 @@ static NSString * const kKBFunctionTagCellId2 = @"KBFunctionTagCellId2";
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
|
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
|
||||||
CGFloat totalW = collectionView.bounds.size.width; CGFloat space = 10.0; NSInteger columns = 3;
|
CGFloat totalW = collectionView.bounds.size.width; CGFloat space = kKBItemSpace; NSInteger columns = 3;
|
||||||
CGFloat width = floor((totalW - space * (columns - 1)) / columns);
|
CGFloat width = floor((totalW - space * (columns - 1)) / columns);
|
||||||
return CGSizeMake(width, 48);
|
return CGSizeMake(width, 41);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout minimumInteritemSpacingForSectionAtIndex:(NSInteger)section { return 10.0; }
|
- (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout minimumInteritemSpacingForSectionAtIndex:(NSInteger)section { return kKBItemSpace; }
|
||||||
- (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout minimumLineSpacingForSectionAtIndex:(NSInteger)section { return 12.0; }
|
- (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout minimumLineSpacingForSectionAtIndex:(NSInteger)section { return kKBItemSpace; }
|
||||||
|
|
||||||
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
|
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
|
||||||
if ([self.delegate respondsToSelector:@selector(tagListView:didSelectIndex:title:)]) {
|
if ([self.delegate respondsToSelector:@selector(tagListView:didSelectIndex:title:)]) {
|
||||||
|
|||||||
@@ -9,7 +9,9 @@
|
|||||||
|
|
||||||
NS_ASSUME_NONNULL_BEGIN
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
/// 功能区顶部的Bar:左侧4个按钮,右侧3个按钮
|
/// 功能区顶部的 Bar:
|
||||||
|
/// 左侧:App 图标按钮(点击可回到主 App 或打开更多功能)
|
||||||
|
/// 右侧:升级 VIP 按钮
|
||||||
@class KBFunctionBarView;
|
@class KBFunctionBarView;
|
||||||
|
|
||||||
@protocol KBFunctionBarViewDelegate <NSObject>
|
@protocol KBFunctionBarViewDelegate <NSObject>
|
||||||
@@ -24,15 +26,15 @@ NS_ASSUME_NONNULL_BEGIN
|
|||||||
|
|
||||||
@property (nonatomic, weak, nullable) id<KBFunctionBarViewDelegate> delegate;
|
@property (nonatomic, weak, nullable) id<KBFunctionBarViewDelegate> delegate;
|
||||||
|
|
||||||
/// 左侧4个按钮(懒加载创建,等宽水平排布)
|
/// 左侧按钮(当前只有一个:App 图标)
|
||||||
@property (nonatomic, strong, readonly) NSArray<UIButton *> *leftButtons;
|
@property (nonatomic, strong, readonly) NSArray<UIButton *> *leftButtons;
|
||||||
|
|
||||||
/// 右侧3个按钮(懒加载创建,等宽水平排布,靠右)
|
/// 右侧按钮(当前只有一个:升级 VIP)
|
||||||
@property (nonatomic, strong, readonly) NSArray<UIButton *> *rightButtons;
|
@property (nonatomic, strong, readonly) NSArray<UIButton *> *rightButtons;
|
||||||
|
|
||||||
/// 配置按钮标题(可选)
|
/// 预留的标题配置(目前按钮主要以图片为主,可选)
|
||||||
@property (nonatomic, copy) NSArray<NSString *> *leftTitles; // 默认 @[@"帮回", @"会说", @"话术", @"更多"]
|
@property (nonatomic, copy) NSArray<NSString *> *leftTitles;
|
||||||
@property (nonatomic, copy) NSArray<NSString *> *rightTitles; // 默认 @[@"❤", @"收藏", @"宫格"]
|
@property (nonatomic, copy) NSArray<NSString *> *rightTitles;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|||||||
@@ -22,8 +22,9 @@
|
|||||||
- (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];
|
||||||
_leftTitles = @[@"ABC"];
|
// 标题字段暂时不用,预留给后续可能的文案按钮
|
||||||
_rightTitles = @[@"Upgrade VIP"];
|
_leftTitles = @[];
|
||||||
|
_rightTitles = @[];
|
||||||
[self buildUI];
|
[self buildUI];
|
||||||
}
|
}
|
||||||
return self;
|
return self;
|
||||||
@@ -38,91 +39,60 @@
|
|||||||
#pragma mark - UI
|
#pragma mark - UI
|
||||||
|
|
||||||
- (void)buildUI {
|
- (void)buildUI {
|
||||||
// 左右两个容器,方便分别布局
|
// 左右容器 + 可选地球键
|
||||||
[self addSubview:self.leftContainer];
|
|
||||||
[self addSubview:self.globeButtonInternal];
|
[self addSubview:self.globeButtonInternal];
|
||||||
|
[self addSubview:self.leftContainer];
|
||||||
[self addSubview:self.rightContainer];
|
[self addSubview:self.rightContainer];
|
||||||
|
|
||||||
|
// 右侧:升级 VIP 按钮(使用资源图 upgrad_vip_icon,设计尺寸 115x35)
|
||||||
[self.rightContainer mas_makeConstraints:^(MASConstraintMaker *make) {
|
[self.rightContainer mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.right.equalTo(self.mas_right).offset(-12);
|
make.right.equalTo(self.mas_right).offset(-6);
|
||||||
make.centerY.equalTo(self.mas_centerY);
|
make.centerY.equalTo(self.mas_centerY);
|
||||||
make.height.mas_equalTo(36);
|
make.width.mas_equalTo(115);
|
||||||
|
make.height.mas_equalTo(35);
|
||||||
}];
|
}];
|
||||||
|
|
||||||
// 左侧地球键(按需显示)
|
UIButton *vipButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||||
|
vipButton.tag = 200; // 右侧 index = 0
|
||||||
|
UIImage *vipImage = [UIImage imageNamed:@"upgrad_vip_icon"];
|
||||||
|
[vipButton setImage:vipImage forState:UIControlStateNormal];
|
||||||
|
vipButton.imageView.contentMode = UIViewContentModeScaleAspectFit;
|
||||||
|
vipButton.adjustsImageWhenHighlighted = YES;
|
||||||
|
[vipButton addTarget:self action:@selector(onRightTap:) forControlEvents:UIControlEventTouchUpInside];
|
||||||
|
[self.rightContainer addSubview:vipButton];
|
||||||
|
[vipButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
|
make.edges.equalTo(self.rightContainer);
|
||||||
|
}];
|
||||||
|
self.rightButtonsInternal = @[vipButton];
|
||||||
|
|
||||||
|
// 左侧地球键(按需显示,由 kb_refreshGlobeVisibility 控制是否展示)
|
||||||
[self.globeButtonInternal mas_makeConstraints:^(MASConstraintMaker *make) {
|
[self.globeButtonInternal mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.left.equalTo(self.mas_left).offset(12);
|
make.left.equalTo(self.mas_left).offset(12);
|
||||||
make.centerY.equalTo(self.mas_centerY);
|
make.centerY.equalTo(self.mas_centerY);
|
||||||
make.width.height.mas_equalTo(32);
|
make.width.height.mas_equalTo(32);
|
||||||
}];
|
}];
|
||||||
|
|
||||||
|
// 左侧:App 图标按钮(使用资源图 App_icon,图标 34x34,按钮容器 36x36)
|
||||||
[self.leftContainer mas_makeConstraints:^(MASConstraintMaker *make) {
|
[self.leftContainer mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.left.equalTo(self.globeButtonInternal.mas_right).offset(8);
|
|
||||||
make.right.equalTo(self.rightContainer.mas_left).offset(-12);
|
|
||||||
make.centerY.equalTo(self.mas_centerY);
|
make.centerY.equalTo(self.mas_centerY);
|
||||||
|
make.width.mas_equalTo(36);
|
||||||
make.height.mas_equalTo(36);
|
make.height.mas_equalTo(36);
|
||||||
|
make.left.equalTo(self.mas_left).offset(12); // 具体偏移在 kb_refreshGlobeVisibility 中会根据地球键重新设置
|
||||||
}];
|
}];
|
||||||
|
|
||||||
// 左侧4个等宽按钮
|
UIButton *appButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||||
NSMutableArray<UIButton *> *leftBtns = [NSMutableArray arrayWithCapacity:4];
|
appButton.tag = 100; // 左侧 index = 0
|
||||||
UIView *prev = nil;
|
UIImage *appImage = [UIImage imageNamed:@"App_icon"];
|
||||||
for (NSInteger i = 0; i < self.leftTitles.count; i++) {
|
[appButton setImage:appImage forState:UIControlStateNormal];
|
||||||
UIButton *btn = [self buildButtonWithTitle:(i < self.leftTitles.count ? self.leftTitles[i] : [NSString stringWithFormat:@"L%ld", (long)i])];
|
appButton.imageView.contentMode = UIViewContentModeScaleAspectFit;
|
||||||
btn.tag = 100 + i;
|
appButton.adjustsImageWhenHighlighted = YES;
|
||||||
[btn addTarget:self action:@selector(onLeftTap:) forControlEvents:UIControlEventTouchUpInside];
|
[appButton addTarget:self action:@selector(onLeftTap:) forControlEvents:UIControlEventTouchUpInside];
|
||||||
[self.leftContainer addSubview:btn];
|
[self.leftContainer addSubview:appButton];
|
||||||
[btn mas_makeConstraints:^(MASConstraintMaker *make) {
|
[appButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
if (prev) {
|
make.center.equalTo(self.leftContainer);
|
||||||
make.left.equalTo(prev.mas_right).offset(8);
|
make.width.height.mas_equalTo(34); // 设计图尺寸
|
||||||
make.width.equalTo(prev);
|
|
||||||
} else {
|
|
||||||
make.left.equalTo(self.leftContainer.mas_left);
|
|
||||||
}
|
|
||||||
make.top.bottom.equalTo(self.leftContainer);
|
|
||||||
}];
|
}];
|
||||||
prev = btn;
|
self.leftButtonsInternal = @[appButton];
|
||||||
[leftBtns addObject:btn];
|
|
||||||
}
|
|
||||||
[prev mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
||||||
make.right.equalTo(self.leftContainer.mas_right);
|
|
||||||
}];
|
|
||||||
self.leftButtonsInternal = leftBtns.copy;
|
|
||||||
|
|
||||||
// 右侧N个按钮(靠右、两两等宽)
|
|
||||||
NSMutableArray<UIButton *> *rightBtns = [NSMutableArray arrayWithCapacity:3];
|
|
||||||
for (NSInteger i = 0; i < self.rightTitles.count; i++) {
|
|
||||||
UIButton *btn = [self buildButtonWithTitle:(i < self.rightTitles.count ? self.rightTitles[i] : [NSString stringWithFormat:@"R%ld", (long)i])];
|
|
||||||
btn.tag = 200 + i;
|
|
||||||
[self.rightContainer addSubview:btn];
|
|
||||||
[btn addTarget:self action:@selector(onRightTap:) forControlEvents:UIControlEventTouchUpInside];
|
|
||||||
[rightBtns addObject:btn];
|
|
||||||
}
|
|
||||||
|
|
||||||
// 从右往左链式布局,保证整体靠右;支持 1/2/3... 任意数量
|
|
||||||
UIView *prevRight = nil; // 指向右侧已布局的按钮
|
|
||||||
for (NSInteger i = rightBtns.count - 1; i >= 0; i--) {
|
|
||||||
UIButton *btn = rightBtns[i];
|
|
||||||
[btn mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
||||||
if (!prevRight) {
|
|
||||||
// 最右侧按钮贴右
|
|
||||||
make.right.equalTo(self.rightContainer.mas_right);
|
|
||||||
} else {
|
|
||||||
// 其余按钮紧挨左侧兄弟,且与其等宽
|
|
||||||
make.right.equalTo(prevRight.mas_left).offset(-8);
|
|
||||||
make.width.equalTo(prevRight);
|
|
||||||
}
|
|
||||||
make.top.bottom.equalTo(self.rightContainer);
|
|
||||||
}];
|
|
||||||
prevRight = btn;
|
|
||||||
}
|
|
||||||
// 最左侧一个不超出容器左边(允许根据内容自然宽度收缩)
|
|
||||||
if (prevRight) {
|
|
||||||
[prevRight mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
||||||
make.left.greaterThanOrEqualTo(self.rightContainer.mas_left);
|
|
||||||
}];
|
|
||||||
}
|
|
||||||
|
|
||||||
self.rightButtonsInternal = rightBtns.copy;
|
|
||||||
|
|
||||||
// 初始刷新地球键可见性与事件绑定
|
// 初始刷新地球键可见性与事件绑定
|
||||||
[self kb_refreshGlobeVisibility];
|
[self kb_refreshGlobeVisibility];
|
||||||
@@ -144,17 +114,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (UIButton *)buildButtonWithTitle:(NSString *)title {
|
|
||||||
UIButton *btn = [UIButton buttonWithType:UIButtonTypeSystem];
|
|
||||||
btn.layer.cornerRadius = 18;
|
|
||||||
btn.layer.masksToBounds = YES;
|
|
||||||
btn.backgroundColor = [UIColor colorWithWhite:1 alpha:0.9];
|
|
||||||
btn.titleLabel.font = [UIFont systemFontOfSize:14 weight:UIFontWeightMedium];
|
|
||||||
[btn setTitle:title forState:UIControlStateNormal];
|
|
||||||
[btn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
|
|
||||||
return btn;
|
|
||||||
}
|
|
||||||
|
|
||||||
#pragma mark - Lazy
|
#pragma mark - Lazy
|
||||||
|
|
||||||
- (UIView *)leftContainer {
|
- (UIView *)leftContainer {
|
||||||
@@ -201,8 +160,8 @@
|
|||||||
} else {
|
} else {
|
||||||
make.left.equalTo(self.mas_left).offset(12);
|
make.left.equalTo(self.mas_left).offset(12);
|
||||||
}
|
}
|
||||||
make.right.equalTo(self.rightContainer.mas_left).offset(-12);
|
|
||||||
make.centerY.equalTo(self.mas_centerY);
|
make.centerY.equalTo(self.mas_centerY);
|
||||||
|
make.width.mas_equalTo(36);
|
||||||
make.height.mas_equalTo(36);
|
make.height.mas_equalTo(36);
|
||||||
}];
|
}];
|
||||||
|
|
||||||
|
|||||||
@@ -7,10 +7,13 @@
|
|||||||
|
|
||||||
#import "KBFunctionPasteView.h"
|
#import "KBFunctionPasteView.h"
|
||||||
#import "Masonry.h"
|
#import "Masonry.h"
|
||||||
|
#import "KBFont.h"
|
||||||
|
|
||||||
@interface KBFunctionPasteView ()
|
@interface KBFunctionPasteView ()
|
||||||
@property (nonatomic, strong) UIImageView *iconViewInternal;
|
@property (nonatomic, strong) UIImageView *iconViewInternal;
|
||||||
@property (nonatomic, strong) UILabel *placeholderLabelInternal;
|
@property (nonatomic, strong) UILabel *placeholderLabelInternal;
|
||||||
|
@property (nonatomic, strong) UIButton *pasBtn;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation KBFunctionPasteView
|
@implementation KBFunctionPasteView
|
||||||
@@ -22,19 +25,24 @@
|
|||||||
self.layer.cornerRadius = 12.0;
|
self.layer.cornerRadius = 12.0;
|
||||||
self.layer.masksToBounds = YES;
|
self.layer.masksToBounds = YES;
|
||||||
|
|
||||||
[self addSubview:self.iconViewInternal];
|
// [self addSubview:self.iconViewInternal];
|
||||||
[self addSubview:self.placeholderLabelInternal];
|
// [self addSubview:self.placeholderLabelInternal];
|
||||||
|
[self addSubview:self.pasBtn];
|
||||||
|
[self.pasBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
|
make.edges.equalTo(self);
|
||||||
|
}];
|
||||||
|
|
||||||
|
// [self.iconViewInternal mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
|
// make.left.equalTo(self.mas_left).offset(12);
|
||||||
|
// make.centerY.equalTo(self.mas_centerY);
|
||||||
|
// make.width.height.mas_equalTo(20);
|
||||||
|
// }];
|
||||||
|
// [self.placeholderLabelInternal mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
|
// make.left.equalTo(self.iconViewInternal.mas_right).offset(8);
|
||||||
|
// make.right.equalTo(self.mas_right).offset(-12);
|
||||||
|
// make.centerY.equalTo(self.mas_centerY);
|
||||||
|
// }];
|
||||||
|
|
||||||
[self.iconViewInternal mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
||||||
make.left.equalTo(self.mas_left).offset(12);
|
|
||||||
make.centerY.equalTo(self.mas_centerY);
|
|
||||||
make.width.height.mas_equalTo(20);
|
|
||||||
}];
|
|
||||||
[self.placeholderLabelInternal mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
||||||
make.left.equalTo(self.iconViewInternal.mas_right).offset(8);
|
|
||||||
make.right.equalTo(self.mas_right).offset(-12);
|
|
||||||
make.centerY.equalTo(self.mas_centerY);
|
|
||||||
}];
|
|
||||||
}
|
}
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
@@ -44,15 +52,7 @@
|
|||||||
- (UIImageView *)iconViewInternal {
|
- (UIImageView *)iconViewInternal {
|
||||||
if (!_iconViewInternal) {
|
if (!_iconViewInternal) {
|
||||||
_iconViewInternal = [[UIImageView alloc] init];
|
_iconViewInternal = [[UIImageView alloc] init];
|
||||||
// 用简单的系统表情代替资源图(项目可替换成实际图片)
|
_iconViewInternal.image = [UIImage imageNamed:@"kb_zt_icon"];
|
||||||
UILabel *emoji = [[UILabel alloc] init];
|
|
||||||
emoji.text = @"📋"; // 粘贴/剪贴板含义
|
|
||||||
emoji.font = [UIFont systemFontOfSize:18];
|
|
||||||
emoji.textAlignment = NSTextAlignmentCenter;
|
|
||||||
[_iconViewInternal addSubview:emoji];
|
|
||||||
[emoji mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
||||||
make.edges.equalTo(_iconViewInternal);
|
|
||||||
}];
|
|
||||||
}
|
}
|
||||||
return _iconViewInternal;
|
return _iconViewInternal;
|
||||||
}
|
}
|
||||||
@@ -60,13 +60,26 @@
|
|||||||
- (UILabel *)placeholderLabelInternal {
|
- (UILabel *)placeholderLabelInternal {
|
||||||
if (!_placeholderLabelInternal) {
|
if (!_placeholderLabelInternal) {
|
||||||
_placeholderLabelInternal = [[UILabel alloc] init];
|
_placeholderLabelInternal = [[UILabel alloc] init];
|
||||||
_placeholderLabelInternal.text = KBLocalized(@"Tap to paste their message");
|
// 文案改为更贴近设计稿
|
||||||
|
_placeholderLabelInternal.text = KBLocalized(@"Paste Ta's Words");
|
||||||
_placeholderLabelInternal.textColor = [UIColor colorWithRed:0.20 green:0.64 blue:0.54 alpha:1.0];
|
_placeholderLabelInternal.textColor = [UIColor colorWithRed:0.20 green:0.64 blue:0.54 alpha:1.0];
|
||||||
_placeholderLabelInternal.font = [UIFont systemFontOfSize:16 weight:UIFontWeightMedium];
|
_placeholderLabelInternal.font = [UIFont systemFontOfSize:16 weight:UIFontWeightMedium];
|
||||||
}
|
}
|
||||||
return _placeholderLabelInternal;
|
return _placeholderLabelInternal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (UIButton *)pasBtn{
|
||||||
|
if (!_pasBtn) {
|
||||||
|
_pasBtn = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||||
|
[_pasBtn setImage:[UIImage imageNamed:@"kb_zt_icon"] forState:UIControlStateNormal];
|
||||||
|
[_pasBtn setTitle:KBLocalized(@" Paste Ta's Words") forState:UIControlStateNormal];
|
||||||
|
[_pasBtn setTitleColor:[UIColor colorWithHex:0x02BEAC] forState:UIControlStateNormal];
|
||||||
|
_pasBtn.titleLabel.font = [KBFont medium:13];
|
||||||
|
_pasBtn.backgroundColor = [UIColor whiteColor];
|
||||||
|
}
|
||||||
|
return _pasBtn;
|
||||||
|
}
|
||||||
|
|
||||||
#pragma mark - Expose
|
#pragma mark - Expose
|
||||||
|
|
||||||
- (UIImageView *)iconView { return self.iconViewInternal; }
|
- (UIImageView *)iconView { return self.iconViewInternal; }
|
||||||
|
|||||||
@@ -22,26 +22,38 @@
|
|||||||
self.contentView.layer.cornerRadius = 12;
|
self.contentView.layer.cornerRadius = 12;
|
||||||
self.contentView.layer.masksToBounds = YES;
|
self.contentView.layer.masksToBounds = YES;
|
||||||
|
|
||||||
[self.contentView addSubview:self.iconViewInternal];
|
// 小菊花:默认隐藏,放在整体内容右侧偏内的位置
|
||||||
[self.contentView addSubview:self.titleLabelInternal];
|
[self.contentView addSubview:self.loadingView];
|
||||||
|
[self.loadingView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
|
make.center.equalTo(self.contentView);
|
||||||
|
make.width.height.mas_equalTo(16);
|
||||||
|
}];
|
||||||
|
|
||||||
|
// 中心容器:将 icon + title 组合整体水平居中
|
||||||
|
UIView *centerContainer = [[UIView alloc] init];
|
||||||
|
centerContainer.backgroundColor = [UIColor clearColor];
|
||||||
|
[self.contentView addSubview:centerContainer];
|
||||||
|
[centerContainer mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
|
make.centerX.equalTo(self.contentView.mas_centerX);
|
||||||
|
make.centerY.equalTo(self.contentView.mas_centerY);
|
||||||
|
make.left.greaterThanOrEqualTo(self.contentView.mas_left).offset(6);
|
||||||
|
make.right.lessThanOrEqualTo(self.contentView).offset(-6);
|
||||||
|
}];
|
||||||
|
|
||||||
|
[centerContainer addSubview:self.iconViewInternal];
|
||||||
|
[centerContainer addSubview:self.titleLabelInternal];
|
||||||
|
|
||||||
[self.iconViewInternal mas_makeConstraints:^(MASConstraintMaker *make) {
|
[self.iconViewInternal mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.left.equalTo(self.contentView.mas_left).offset(10);
|
make.left.equalTo(centerContainer.mas_left);
|
||||||
make.centerY.equalTo(self.contentView.mas_centerY);
|
make.centerY.equalTo(centerContainer.mas_centerY);
|
||||||
|
// 留出一点余量,避免 emoji 字形在右侧被裁剪
|
||||||
make.width.height.mas_equalTo(24);
|
make.width.height.mas_equalTo(24);
|
||||||
}];
|
}];
|
||||||
[self.titleLabelInternal mas_makeConstraints:^(MASConstraintMaker *make) {
|
[self.titleLabelInternal mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.left.equalTo(self.iconViewInternal.mas_right).offset(6);
|
make.left.equalTo(self.iconViewInternal.mas_right).offset(3);
|
||||||
make.right.equalTo(self.contentView.mas_right).offset(-10);
|
make.top.equalTo(centerContainer.mas_top);
|
||||||
make.centerY.equalTo(self.contentView.mas_centerY);
|
make.bottom.equalTo(centerContainer.mas_bottom);
|
||||||
}];
|
make.right.equalTo(centerContainer.mas_right);
|
||||||
|
|
||||||
// 小菊花:默认隐藏,放在标题右侧
|
|
||||||
[self.contentView addSubview:self.loadingView];
|
|
||||||
[self.loadingView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
||||||
make.centerY.equalTo(self.contentView);
|
|
||||||
make.right.equalTo(self.contentView.mas_right).offset(-10);
|
|
||||||
make.width.height.mas_equalTo(16);
|
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
return self;
|
return self;
|
||||||
@@ -56,6 +68,8 @@
|
|||||||
emoji.text = @"🙂"; // 占位图标
|
emoji.text = @"🙂"; // 占位图标
|
||||||
emoji.textAlignment = NSTextAlignmentCenter;
|
emoji.textAlignment = NSTextAlignmentCenter;
|
||||||
emoji.font = [UIFont systemFontOfSize:20];
|
emoji.font = [UIFont systemFontOfSize:20];
|
||||||
|
emoji.adjustsFontSizeToFitWidth = YES;
|
||||||
|
emoji.minimumScaleFactor = 0.8;
|
||||||
[_iconViewInternal addSubview:emoji];
|
[_iconViewInternal addSubview:emoji];
|
||||||
[emoji mas_makeConstraints:^(MASConstraintMaker *make) {
|
[emoji mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.edges.equalTo(_iconViewInternal);
|
make.edges.equalTo(_iconViewInternal);
|
||||||
@@ -67,8 +81,11 @@
|
|||||||
- (UILabel *)titleLabelInternal {
|
- (UILabel *)titleLabelInternal {
|
||||||
if (!_titleLabelInternal) {
|
if (!_titleLabelInternal) {
|
||||||
_titleLabelInternal = [[UILabel alloc] init];
|
_titleLabelInternal = [[UILabel alloc] init];
|
||||||
_titleLabelInternal.font = [UIFont systemFontOfSize:15 weight:UIFontWeightSemibold];
|
_titleLabelInternal.font = [KBFont medium:10];
|
||||||
_titleLabelInternal.textColor = [UIColor blackColor];
|
_titleLabelInternal.textColor = [UIColor colorWithHex:0x1B1F1A];
|
||||||
|
// 最多两行,文本过长时末尾截断
|
||||||
|
_titleLabelInternal.numberOfLines = 2;
|
||||||
|
_titleLabelInternal.lineBreakMode = NSLineBreakByTruncatingTail;
|
||||||
}
|
}
|
||||||
return _titleLabelInternal;
|
return _titleLabelInternal;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,6 +11,8 @@
|
|||||||
@protocol KBFunctionViewDelegate <NSObject>
|
@protocol KBFunctionViewDelegate <NSObject>
|
||||||
@optional
|
@optional
|
||||||
- (void)functionView:(KBFunctionView *_Nullable)functionView didTapToolActionAtIndex:(NSInteger)index;
|
- (void)functionView:(KBFunctionView *_Nullable)functionView didTapToolActionAtIndex:(NSInteger)index;
|
||||||
|
- (void)functionView:(KBFunctionView *_Nullable)functionView didRightTapToolActionAtIndex:(NSInteger)index;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_BEGIN
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|||||||
@@ -106,16 +106,16 @@
|
|||||||
[self.barViewInternal mas_makeConstraints:^(MASConstraintMaker *make) {
|
[self.barViewInternal mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.left.right.equalTo(self);
|
make.left.right.equalTo(self);
|
||||||
make.top.equalTo(self.mas_top).offset(6);
|
make.top.equalTo(self.mas_top).offset(6);
|
||||||
make.height.mas_equalTo(48);
|
make.height.mas_equalTo(52);
|
||||||
}];
|
}];
|
||||||
|
|
||||||
// 右侧竖排按钮容器
|
// 右侧竖排按钮容器
|
||||||
[self addSubview:self.rightButtonContainer];
|
[self addSubview:self.rightButtonContainer];
|
||||||
[self.rightButtonContainer mas_makeConstraints:^(MASConstraintMaker *make) {
|
[self.rightButtonContainer mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.right.equalTo(self.mas_right).offset(-6);
|
make.right.equalTo(self.mas_right).offset(-4);
|
||||||
make.top.equalTo(self.barViewInternal.mas_bottom).offset(8);
|
make.top.equalTo(self.barViewInternal.mas_bottom).offset(0);
|
||||||
make.bottom.equalTo(self.mas_bottom).offset(-10);
|
make.bottom.equalTo(self.mas_bottom).offset(-10);
|
||||||
make.width.mas_equalTo(72);
|
make.width.mas_equalTo(60);
|
||||||
}];
|
}];
|
||||||
|
|
||||||
// 右侧四个按钮
|
// 右侧四个按钮
|
||||||
@@ -125,10 +125,10 @@
|
|||||||
[self.rightButtonContainer addSubview:self.sendButtonInternal];
|
[self.rightButtonContainer addSubview:self.sendButtonInternal];
|
||||||
|
|
||||||
// 竖向排布:粘贴、删除、清空为等高;发送优先更高,但允许在空间不足时压缩
|
// 竖向排布:粘贴、删除、清空为等高;发送优先更高,但允许在空间不足时压缩
|
||||||
CGFloat smallH = 44;
|
CGFloat smallH = 41;
|
||||||
CGFloat bigH = 56;
|
CGFloat bigH = 56;
|
||||||
// 原 10 在键盘总高度 276 下容易超出容器,改为 8 以避免 AutoLayout 冲突
|
// 原 10 在键盘总高度 276 下容易超出容器,改为 8 以避免 AutoLayout 冲突
|
||||||
CGFloat vSpace = 8;
|
CGFloat vSpace = 4;
|
||||||
[self.pasteButtonInternal mas_makeConstraints:^(MASConstraintMaker *make) {
|
[self.pasteButtonInternal mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.top.equalTo(self.rightButtonContainer.mas_top);
|
make.top.equalTo(self.rightButtonContainer.mas_top);
|
||||||
make.left.right.equalTo(self.rightButtonContainer);
|
make.left.right.equalTo(self.rightButtonContainer);
|
||||||
@@ -156,18 +156,18 @@
|
|||||||
// 2. 粘贴区(位于右侧按钮左侧)
|
// 2. 粘贴区(位于右侧按钮左侧)
|
||||||
[self addSubview:self.pasteViewInternal];
|
[self addSubview:self.pasteViewInternal];
|
||||||
[self.pasteViewInternal mas_makeConstraints:^(MASConstraintMaker *make) {
|
[self.pasteViewInternal mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.left.equalTo(self.mas_left).offset(12);
|
make.left.equalTo(self.mas_left).offset(vSpace);
|
||||||
make.right.equalTo(self.rightButtonContainer.mas_left).offset(-12);
|
make.right.equalTo(self.rightButtonContainer.mas_left).offset(-vSpace);
|
||||||
make.top.equalTo(self.barViewInternal.mas_bottom).offset(8);
|
make.top.equalTo(self.barViewInternal.mas_bottom).offset(0);
|
||||||
make.height.mas_equalTo(48);
|
make.height.mas_equalTo(smallH);
|
||||||
}];
|
}];
|
||||||
|
|
||||||
// 3. Tag List View
|
// 3. Tag List View
|
||||||
[self addSubview:self.tagListView];
|
[self addSubview:self.tagListView];
|
||||||
[self.tagListView mas_makeConstraints:^(MASConstraintMaker *make) {
|
[self.tagListView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.left.equalTo(self.mas_left).offset(12);
|
make.left.equalTo(self.pasteViewInternal);
|
||||||
make.right.equalTo(self.rightButtonContainer.mas_left).offset(-12);
|
make.right.equalTo(self.rightButtonContainer.mas_left).offset(-vSpace);
|
||||||
make.top.equalTo(self.pasteViewInternal.mas_bottom).offset(10);
|
make.top.equalTo(self.pasteViewInternal.mas_bottom).offset(vSpace);
|
||||||
make.bottom.equalTo(self.mas_bottom).offset(-10);
|
make.bottom.equalTo(self.mas_bottom).offset(-10);
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
@@ -176,13 +176,13 @@
|
|||||||
|
|
||||||
- (void)reloadDemoData {
|
- (void)reloadDemoData {
|
||||||
// 演示数据(可由外部替换)
|
// 演示数据(可由外部替换)
|
||||||
self.itemsInternal = @[KBLocalized(@"高情商"),
|
self.itemsInternal = @[KBLocalized(@"Warm hearted man"),
|
||||||
KBLocalized(@"暖味拉扯"),
|
KBLocalized(@"Warm2 hearted man"),
|
||||||
KBLocalized(@"风趣幽默"),
|
KBLocalized(@"Warm3 hearted man"),
|
||||||
KBLocalized(@"撩女生"),
|
KBLocalized(@"撩女生啊u发顺丰大师傅"),
|
||||||
KBLocalized(@"社交惬匿"),
|
KBLocalized(@"Warm = man"),
|
||||||
KBLocalized(@"情场高手"),
|
KBLocalized(@"Warm hearted man"),
|
||||||
KBLocalized(@"一枚暖男"),
|
KBLocalized(@"一枚暖男发放"),
|
||||||
KBLocalized(@"聊天搭子"),
|
KBLocalized(@"聊天搭子"),
|
||||||
KBLocalized(@"表达爱意"),
|
KBLocalized(@"表达爱意"),
|
||||||
KBLocalized(@"更多话术")];
|
KBLocalized(@"更多话术")];
|
||||||
@@ -537,6 +537,9 @@ static void KBULDarwinCallback(CFNotificationCenterRef center, void *observer, C
|
|||||||
|
|
||||||
- (void)functionBarView:(KBFunctionBarView *)bar didTapRightAtIndex:(NSInteger)index {
|
- (void)functionBarView:(KBFunctionBarView *)bar didTapRightAtIndex:(NSInteger)index {
|
||||||
// 右侧按钮点击,如收藏/宫格等,按需继续向外抛出(这里暂不定义单独协议方法,可在此内部处理或扩展)
|
// 右侧按钮点击,如收藏/宫格等,按需继续向外抛出(这里暂不定义单独协议方法,可在此内部处理或扩展)
|
||||||
|
if ([self.delegate respondsToSelector:@selector(functionView:didRightTapToolActionAtIndex:)]) {
|
||||||
|
[self.delegate functionView:self didRightTapToolActionAtIndex:index];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (KBFunctionPasteView *)pasteViewInternal {
|
- (KBFunctionPasteView *)pasteViewInternal {
|
||||||
@@ -563,11 +566,11 @@ static void KBULDarwinCallback(CFNotificationCenterRef center, void *observer, C
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (UIButton *)buildRightButtonWithTitle:(NSString *)title color:(UIColor *)color {
|
- (UIButton *)buildRightButtonWithTitle:(NSString *)title color:(UIColor *)color {
|
||||||
UIButton *btn = [UIButton buttonWithType:UIButtonTypeSystem];
|
UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||||
btn.backgroundColor = color;
|
btn.backgroundColor = color;
|
||||||
btn.layer.cornerRadius = 12.0;
|
btn.layer.cornerRadius = 8.0;
|
||||||
btn.layer.masksToBounds = YES;
|
btn.layer.masksToBounds = YES;
|
||||||
btn.titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightSemibold];
|
btn.titleLabel.font = [KBFont medium:13];
|
||||||
[btn setTitle:title forState:UIControlStateNormal];
|
[btn setTitle:title forState:UIControlStateNormal];
|
||||||
[btn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
[btn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
||||||
return btn;
|
return btn;
|
||||||
@@ -583,14 +586,12 @@ static void KBULDarwinCallback(CFNotificationCenterRef center, void *observer, C
|
|||||||
|
|
||||||
- (UIButton *)deleteButtonInternal {
|
- (UIButton *)deleteButtonInternal {
|
||||||
if (!_deleteButtonInternal) {
|
if (!_deleteButtonInternal) {
|
||||||
// 浅灰底深色文字,更接近截图里“删除”样式
|
_deleteButtonInternal = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||||
_deleteButtonInternal = [UIButton buttonWithType:UIButtonTypeSystem];
|
_deleteButtonInternal.backgroundColor = [UIColor colorWithHex:0xB9BDC8];
|
||||||
_deleteButtonInternal.backgroundColor = [UIColor colorWithWhite:0.92 alpha:1.0];
|
_deleteButtonInternal.layer.cornerRadius = 8.0;
|
||||||
_deleteButtonInternal.layer.cornerRadius = 12.0;
|
|
||||||
_deleteButtonInternal.layer.masksToBounds = YES;
|
_deleteButtonInternal.layer.masksToBounds = YES;
|
||||||
_deleteButtonInternal.titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightSemibold];
|
[_deleteButtonInternal setImage:[UIImage imageNamed:@"kb_del_icon"] forState:UIControlStateNormal];
|
||||||
[_deleteButtonInternal setTitle:KBLocalized(@"Delete") forState:UIControlStateNormal];
|
|
||||||
[_deleteButtonInternal setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
|
|
||||||
[_deleteButtonInternal addTarget:self action:@selector(onTapDelete) forControlEvents:UIControlEventTouchUpInside];
|
[_deleteButtonInternal addTarget:self action:@selector(onTapDelete) forControlEvents:UIControlEventTouchUpInside];
|
||||||
}
|
}
|
||||||
return _deleteButtonInternal;
|
return _deleteButtonInternal;
|
||||||
@@ -598,11 +599,11 @@ static void KBULDarwinCallback(CFNotificationCenterRef center, void *observer, C
|
|||||||
|
|
||||||
- (UIButton *)clearButtonInternal {
|
- (UIButton *)clearButtonInternal {
|
||||||
if (!_clearButtonInternal) {
|
if (!_clearButtonInternal) {
|
||||||
_clearButtonInternal = [UIButton buttonWithType:UIButtonTypeSystem];
|
_clearButtonInternal = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||||
_clearButtonInternal.backgroundColor = [UIColor colorWithWhite:0.92 alpha:1.0];
|
_clearButtonInternal.backgroundColor = [UIColor colorWithHex:0xB9BDC8];
|
||||||
_clearButtonInternal.layer.cornerRadius = 12.0;
|
_clearButtonInternal.layer.cornerRadius = 8.0;
|
||||||
_clearButtonInternal.layer.masksToBounds = YES;
|
_clearButtonInternal.layer.masksToBounds = YES;
|
||||||
_clearButtonInternal.titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightSemibold];
|
_clearButtonInternal.titleLabel.font = [KBFont medium:13];
|
||||||
[_clearButtonInternal setTitle:KBLocalized(@"Clear") forState:UIControlStateNormal];
|
[_clearButtonInternal setTitle:KBLocalized(@"Clear") forState:UIControlStateNormal];
|
||||||
[_clearButtonInternal setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
|
[_clearButtonInternal setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
|
||||||
[_clearButtonInternal addTarget:self action:@selector(onTapClear) forControlEvents:UIControlEventTouchUpInside];
|
[_clearButtonInternal addTarget:self action:@selector(onTapClear) forControlEvents:UIControlEventTouchUpInside];
|
||||||
@@ -612,7 +613,7 @@ static void KBULDarwinCallback(CFNotificationCenterRef center, void *observer, C
|
|||||||
|
|
||||||
- (UIButton *)sendButtonInternal {
|
- (UIButton *)sendButtonInternal {
|
||||||
if (!_sendButtonInternal) {
|
if (!_sendButtonInternal) {
|
||||||
_sendButtonInternal = [self buildRightButtonWithTitle:KBLocalized(@"Send") color:[UIColor colorWithRed:0.13 green:0.73 blue:0.60 alpha:1.0]];
|
_sendButtonInternal = [self buildRightButtonWithTitle:KBLocalized(@"Send") color:[UIColor colorWithHex:0x02BEAC]];
|
||||||
[_sendButtonInternal addTarget:self action:@selector(onTapSend) forControlEvents:UIControlEventTouchUpInside];
|
[_sendButtonInternal addTarget:self action:@selector(onTapSend) forControlEvents:UIControlEventTouchUpInside];
|
||||||
}
|
}
|
||||||
return _sendButtonInternal;
|
return _sendButtonInternal;
|
||||||
|
|||||||
@@ -110,6 +110,8 @@
|
|||||||
"Gender" = "Gender";
|
"Gender" = "Gender";
|
||||||
"User ID" = "User ID";
|
"User ID" = "User ID";
|
||||||
|
|
||||||
|
" Paste Ta's Words" = " Paste Ta's Words";
|
||||||
|
|
||||||
|
|
||||||
// Search & history
|
// Search & history
|
||||||
"Clear history" = "Clear history";
|
"Clear history" = "Clear history";
|
||||||
|
|||||||
@@ -111,6 +111,8 @@
|
|||||||
"Gender" = "性别";
|
"Gender" = "性别";
|
||||||
"User ID" = "用户ID";
|
"User ID" = "用户ID";
|
||||||
|
|
||||||
|
" Paste Ta's Words" = " 粘贴TA的话";
|
||||||
|
|
||||||
// 搜索与历史(英文 key)
|
// 搜索与历史(英文 key)
|
||||||
"Clear history" = "清空历史";
|
"Clear history" = "清空历史";
|
||||||
"Delete all history?" = "是否删除所有历史记录?";
|
"Delete all history?" = "是否删除所有历史记录?";
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
#import "FGIAPManager.h"
|
#import "FGIAPManager.h"
|
||||||
#import "KBSexSelVC.h"
|
#import "KBSexSelVC.h"
|
||||||
#import "KBKeyboardPermissionManager.h"
|
#import "KBKeyboardPermissionManager.h"
|
||||||
|
#import "KBVipPay.h"
|
||||||
|
|
||||||
// 注意:用于判断系统已启用本输入法扩展的 bundle id 需与扩展 target 的
|
// 注意:用于判断系统已启用本输入法扩展的 bundle id 需与扩展 target 的
|
||||||
// PRODUCT_BUNDLE_IDENTIFIER 完全一致。
|
// PRODUCT_BUNDLE_IDENTIFIER 完全一致。
|
||||||
@@ -140,7 +141,8 @@
|
|||||||
NULL, NULL, true);
|
NULL, NULL, true);
|
||||||
if ([entry isEqualToString:@"recharge"]) {
|
if ([entry isEqualToString:@"recharge"]) {
|
||||||
// 充值入口:拉起主 App 后进入充值相关页面(目前先做占位提示)
|
// 充值入口:拉起主 App 后进入充值相关页面(目前先做占位提示)
|
||||||
[KBHUD showInfo:@"去充值"];
|
// [KBHUD showInfo:@"去充值"];
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// 默认逻辑:登录
|
// 默认逻辑:登录
|
||||||
[self kb_presentLoginSheetIfNeeded];
|
[self kb_presentLoginSheetIfNeeded];
|
||||||
@@ -171,7 +173,9 @@
|
|||||||
return YES;
|
return YES;
|
||||||
}else if ([host isEqualToString:@"recharge"]) { // kbkeyboard://settings
|
}else if ([host isEqualToString:@"recharge"]) { // kbkeyboard://settings
|
||||||
// [self kb_openAppSettings];
|
// [self kb_openAppSettings];
|
||||||
[KBHUD showInfo:@"去充值"];
|
// [KBHUD showInfo:@"去充值"];
|
||||||
|
KBVipPay *vc = [[KBVipPay alloc] init];
|
||||||
|
[KB_CURRENT_NAV pushViewController:vc animated:true];
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
return NO;
|
return NO;
|
||||||
|
|||||||
Reference in New Issue
Block a user