1
This commit is contained in:
@@ -54,7 +54,7 @@
|
|||||||
@property (nonatomic, strong) UIView *bottomBar;
|
@property (nonatomic, strong) UIView *bottomBar;
|
||||||
@property (nonatomic, strong) UIScrollView *tabScrollView;
|
@property (nonatomic, strong) UIScrollView *tabScrollView;
|
||||||
@property (nonatomic, strong) UIStackView *tabStackView;
|
@property (nonatomic, strong) UIStackView *tabStackView;
|
||||||
@property (nonatomic, strong) UIButton *searchButton;
|
//@property (nonatomic, strong) UIButton *searchButton;
|
||||||
@property (nonatomic, strong) NSArray<UIButton *> *tabButtons;
|
@property (nonatomic, strong) NSArray<UIButton *> *tabButtons;
|
||||||
@property (nonatomic, strong) KBEmojiDataProvider *dataProvider;
|
@property (nonatomic, strong) KBEmojiDataProvider *dataProvider;
|
||||||
@property (nonatomic, copy) NSArray<KBEmojiCategory *> *categories;
|
@property (nonatomic, copy) NSArray<KBEmojiCategory *> *categories;
|
||||||
@@ -135,13 +135,13 @@
|
|||||||
self.bottomBar.backgroundColor = [UIColor clearColor];
|
self.bottomBar.backgroundColor = [UIColor clearColor];
|
||||||
[self addSubview:self.bottomBar];
|
[self addSubview:self.bottomBar];
|
||||||
|
|
||||||
self.searchButton = [UIButton buttonWithType:UIButtonTypeSystem];
|
// self.searchButton = [UIButton buttonWithType:UIButtonTypeSystem];
|
||||||
self.searchButton.layer.cornerRadius = 20;
|
// self.searchButton.layer.cornerRadius = 20;
|
||||||
self.searchButton.titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightBold];
|
// self.searchButton.titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightBold];
|
||||||
[self.searchButton setTitle:KBLocalized(@"Search") forState:UIControlStateNormal];
|
// [self.searchButton setTitle:KBLocalized(@"Search") forState:UIControlStateNormal];
|
||||||
[self.searchButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
// [self.searchButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
|
||||||
[self.searchButton addTarget:self action:@selector(onSearch) forControlEvents:UIControlEventTouchUpInside];
|
// [self.searchButton addTarget:self action:@selector(onSearch) forControlEvents:UIControlEventTouchUpInside];
|
||||||
[self.bottomBar addSubview:self.searchButton];
|
// [self.bottomBar addSubview:self.searchButton];
|
||||||
|
|
||||||
self.tabScrollView = [[UIScrollView alloc] init];
|
self.tabScrollView = [[UIScrollView alloc] init];
|
||||||
self.tabScrollView.showsHorizontalScrollIndicator = NO;
|
self.tabScrollView.showsHorizontalScrollIndicator = NO;
|
||||||
@@ -163,19 +163,20 @@
|
|||||||
|
|
||||||
[self.bottomBar mas_makeConstraints:^(MASConstraintMaker *make) {
|
[self.bottomBar mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.left.right.bottom.equalTo(self);
|
make.left.right.bottom.equalTo(self);
|
||||||
make.height.mas_equalTo(72);
|
|
||||||
}];
|
|
||||||
|
|
||||||
[self.searchButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
||||||
make.right.equalTo(self.bottomBar.mas_right).offset(-16);
|
|
||||||
make.centerY.equalTo(self.bottomBar);
|
|
||||||
make.width.mas_equalTo(84);
|
|
||||||
make.height.mas_equalTo(40);
|
make.height.mas_equalTo(40);
|
||||||
}];
|
}];
|
||||||
|
|
||||||
|
// [self.searchButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
|
// make.right.equalTo(self.bottomBar.mas_right).offset(-16);
|
||||||
|
// make.centerY.equalTo(self.bottomBar);
|
||||||
|
// make.width.mas_equalTo(84);
|
||||||
|
// make.height.mas_equalTo(40);
|
||||||
|
// }];
|
||||||
|
|
||||||
[self.tabScrollView mas_makeConstraints:^(MASConstraintMaker *make) {
|
[self.tabScrollView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||||
make.left.equalTo(self.bottomBar.mas_left).offset(12);
|
make.left.equalTo(self.bottomBar.mas_left).offset(12);
|
||||||
make.right.equalTo(self.searchButton.mas_left).offset(-12);
|
// make.right.equalTo(self.searchButton.mas_left).offset(-12);
|
||||||
|
make.right.equalTo(self.bottomBar.mas_right).offset(-12);
|
||||||
make.top.equalTo(self.bottomBar.mas_top).offset(8);
|
make.top.equalTo(self.bottomBar.mas_top).offset(8);
|
||||||
make.bottom.equalTo(self.bottomBar.mas_bottom).offset(-8);
|
make.bottom.equalTo(self.bottomBar.mas_bottom).offset(-8);
|
||||||
}];
|
}];
|
||||||
@@ -231,7 +232,7 @@
|
|||||||
}
|
}
|
||||||
NSMutableArray<UIButton *> *buttons = [NSMutableArray arrayWithCapacity:self.categories.count];
|
NSMutableArray<UIButton *> *buttons = [NSMutableArray arrayWithCapacity:self.categories.count];
|
||||||
[self.categories enumerateObjectsUsingBlock:^(KBEmojiCategory * _Nonnull cat, NSUInteger idx, BOOL * _Nonnull stop) {
|
[self.categories enumerateObjectsUsingBlock:^(KBEmojiCategory * _Nonnull cat, NSUInteger idx, BOOL * _Nonnull stop) {
|
||||||
UIButton *btn = [UIButton buttonWithType:UIButtonTypeSystem];
|
UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
|
||||||
btn.tag = idx;
|
btn.tag = idx;
|
||||||
btn.layer.cornerRadius = 16;
|
btn.layer.cornerRadius = 16;
|
||||||
btn.layer.masksToBounds = YES;
|
btn.layer.masksToBounds = YES;
|
||||||
@@ -319,7 +320,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (void)onLocalizationChanged {
|
- (void)onLocalizationChanged {
|
||||||
[self.searchButton setTitle:KBLocalized(@"Search") forState:UIControlStateNormal];
|
// [self.searchButton setTitle:KBLocalized(@"Search") forState:UIControlStateNormal];
|
||||||
[self reloadData];
|
[self reloadData];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -331,7 +332,7 @@
|
|||||||
self.collectionView.backgroundColor = [UIColor clearColor];
|
self.collectionView.backgroundColor = [UIColor clearColor];
|
||||||
self.titleLabel.textColor = theme.keyTextColor ?: [UIColor whiteColor];
|
self.titleLabel.textColor = theme.keyTextColor ?: [UIColor whiteColor];
|
||||||
UIColor *searchColor = theme.accentColor ?: [UIColor colorWithRed:0.35 green:0.35 blue:0.95 alpha:1];
|
UIColor *searchColor = theme.accentColor ?: [UIColor colorWithRed:0.35 green:0.35 blue:0.95 alpha:1];
|
||||||
self.searchButton.backgroundColor = searchColor;
|
// self.searchButton.backgroundColor = searchColor;
|
||||||
self.tabNormalColor = [UIColor colorWithWhite:1 alpha:0.08];
|
self.tabNormalColor = [UIColor colorWithWhite:1 alpha:0.08];
|
||||||
self.tabSelectedColor = theme.accentColor ?: [UIColor colorWithWhite:1 alpha:0.25];
|
self.tabSelectedColor = theme.accentColor ?: [UIColor colorWithWhite:1 alpha:0.25];
|
||||||
[self updateTabHighlightStates];
|
[self updateTabHighlightStates];
|
||||||
|
|||||||
@@ -40,7 +40,7 @@
|
|||||||
NSDictionary *params = @{ @"receipt": receipt ?: @""};
|
NSDictionary *params = @{ @"receipt": receipt ?: @""};
|
||||||
__weak typeof(self) weakSelf = self;
|
__weak typeof(self) weakSelf = self;
|
||||||
[self.payVM applePayReqWithParams:params needShow:NO completion:^(NSInteger sta, NSString * _Nullable msg) {
|
[self.payVM applePayReqWithParams:params needShow:NO completion:^(NSInteger sta, NSString * _Nullable msg) {
|
||||||
[KBHUD dismiss];
|
// [KBHUD dismiss];
|
||||||
[KBHUD showInfo:(sta == !KBBizCodeSuccess ? KBLocalized(@"Payment failed") : KBLocalized(@"Payment successful"))];
|
[KBHUD showInfo:(sta == !KBBizCodeSuccess ? KBLocalized(@"Payment failed") : KBLocalized(@"Payment successful"))];
|
||||||
if (sta == KBBizCodeSuccess) {
|
if (sta == KBBizCodeSuccess) {
|
||||||
[[SKPaymentQueue defaultQueue] finishTransaction:transaction];
|
[[SKPaymentQueue defaultQueue] finishTransaction:transaction];
|
||||||
|
|||||||
Reference in New Issue
Block a user