From 8bad47528886d4831a5c491af7128ddcaacfb3ad Mon Sep 17 00:00:00 2001 From: CodeST <694468528@qq.com> Date: Wed, 17 Dec 2025 19:08:44 +0800 Subject: [PATCH] 1 --- CustomKeyboard/KeyboardViewController.m | 4 +- ...KBKeyboardSubscriptionFeatureMarqueeView.h | 20 + ...KBKeyboardSubscriptionFeatureMarqueeView.m | 215 ++++++++++ .../View/KBKeyboardSubscriptionOptionCell.h | 18 + .../View/KBKeyboardSubscriptionOptionCell.m | 163 ++++++++ .../View/KBKeyboardSubscriptionView.m | 389 ++---------------- keyBoard.xcodeproj/project.pbxproj | 30 +- 7 files changed, 476 insertions(+), 363 deletions(-) create mode 100644 CustomKeyboard/View/KBKeyboardSubscriptionFeatureMarqueeView.h create mode 100644 CustomKeyboard/View/KBKeyboardSubscriptionFeatureMarqueeView.m create mode 100644 CustomKeyboard/View/KBKeyboardSubscriptionOptionCell.h create mode 100644 CustomKeyboard/View/KBKeyboardSubscriptionOptionCell.m diff --git a/CustomKeyboard/KeyboardViewController.m b/CustomKeyboard/KeyboardViewController.m index 0db22a5..eb0235d 100644 --- a/CustomKeyboard/KeyboardViewController.m +++ b/CustomKeyboard/KeyboardViewController.m @@ -127,8 +127,8 @@ static void KBSkinInstallNotificationCallback(CFNotificationCenterRef center, [self.view addSubview:self.keyBoardMainView]; [self.keyBoardMainView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.right.equalTo(self.view); - make.top.equalTo(self.view).offset(outerVerticalInset); - make.bottom.equalTo(self.view.mas_bottom).offset(-outerVerticalInset); + make.top.equalTo(self.view).offset(0); + make.bottom.equalTo(self.view.mas_bottom).offset(-0); }]; } diff --git a/CustomKeyboard/View/KBKeyboardSubscriptionFeatureMarqueeView.h b/CustomKeyboard/View/KBKeyboardSubscriptionFeatureMarqueeView.h new file mode 100644 index 0000000..2e9b896 --- /dev/null +++ b/CustomKeyboard/View/KBKeyboardSubscriptionFeatureMarqueeView.h @@ -0,0 +1,20 @@ +// +// KBKeyboardSubscriptionFeatureMarqueeView.h +// CustomKeyboard +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +/// 顶部功能点横向自动滚动视图 +@interface KBKeyboardSubscriptionFeatureMarqueeView : UIView + +/// titles/images 数量不一致时,以较小的 count 为准 +- (void)configureWithTitles:(NSArray *)titles + images:(NSArray *)images; + +@end + +NS_ASSUME_NONNULL_END + diff --git a/CustomKeyboard/View/KBKeyboardSubscriptionFeatureMarqueeView.m b/CustomKeyboard/View/KBKeyboardSubscriptionFeatureMarqueeView.m new file mode 100644 index 0000000..9c66d77 --- /dev/null +++ b/CustomKeyboard/View/KBKeyboardSubscriptionFeatureMarqueeView.m @@ -0,0 +1,215 @@ +// +// KBKeyboardSubscriptionFeatureMarqueeView.m +// CustomKeyboard +// + +#import "KBKeyboardSubscriptionFeatureMarqueeView.h" +#import "KBKeyboardSubscriptionFeatureItemView.h" +#import "Masonry.h" + +@interface KBKeyboardSubscriptionFeatureMarqueeView () +@property (nonatomic, strong) UIScrollView *scrollView; +@property (nonatomic, strong) UIView *contentView; +@property (nonatomic, strong) CADisplayLink *displayLink; +@property (nonatomic, assign) CGFloat loopWidth; +@property (nonatomic, copy) NSArray *items; +@end + +@implementation KBKeyboardSubscriptionFeatureMarqueeView + +static const CGFloat kKBFeatureMarqueeItemSpacing = 12.0; +static const CGFloat kKBFeatureMarqueeSpeedPerFrame = 0.35f; + +- (instancetype)initWithFrame:(CGRect)frame { + if (self = [super initWithFrame:frame]) { + self.backgroundColor = [UIColor clearColor]; + [self addSubview:self.scrollView]; + [self.scrollView addSubview:self.contentView]; + + [self.scrollView mas_makeConstraints:^(MASConstraintMaker *make) { + make.edges.equalTo(self); + }]; + [self.contentView mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.bottom.equalTo(self.scrollView); + make.left.equalTo(self.scrollView); + make.height.equalTo(self.scrollView); + make.right.equalTo(self.scrollView); + }]; + } + return self; +} + +- (void)dealloc { + [self stopTicker]; +} + +- (void)didMoveToWindow { + [super didMoveToWindow]; + if (self.window) { + [self startTickerIfNeeded]; + } else { + [self stopTicker]; + } +} + +- (void)setHidden:(BOOL)hidden { + BOOL oldHidden = self.isHidden; + [super setHidden:hidden]; + if (oldHidden == hidden) { return; } + if (hidden) { + [self stopTicker]; + } else if (self.window) { + [self startTickerIfNeeded]; + } +} + +- (void)layoutSubviews { + [super layoutSubviews]; + // 宽度变化时重新评估是否需要滚动 + [self rebuildIfNeeded]; +} + +#pragma mark - Public + +- (void)configureWithTitles:(NSArray *)titles images:(NSArray *)images { + NSInteger count = MIN(titles.count, images.count); + if (count <= 0) { + self.items = @[]; + [self rebuildIfNeeded]; + return; + } + NSMutableArray *arr = [NSMutableArray arrayWithCapacity:(NSUInteger)count]; + for (NSInteger i = 0; i < count; i++) { + NSString *t = titles[(NSUInteger)i] ?: @""; + UIImage *img = images[(NSUInteger)i] ?: [UIImage new]; + [arr addObject:@{@"title": t, @"image": img}]; + } + self.items = [arr copy]; + [self rebuildIfNeeded]; +} + +#pragma mark - Build + +- (void)rebuildIfNeeded { + [self.contentView.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)]; + if (self.items.count == 0) { + self.loopWidth = 0; + self.scrollView.contentSize = CGSizeZero; + self.scrollView.contentOffset = CGPointZero; + [self stopTicker]; + return; + } + + BOOL shouldLoop = (self.items.count > 1); + NSInteger baseCount = self.items.count; + + NSMutableArray *baseWidths = [NSMutableArray arrayWithCapacity:(NSUInteger)baseCount]; + CGFloat baseTotalWidth = 0; + for (NSInteger i = 0; i < baseCount; i++) { + NSDictionary *info = self.items[(NSUInteger)i]; + NSString *title = [info[@"title"] isKindOfClass:NSString.class] ? info[@"title"] : @""; + CGFloat w = [KBKeyboardSubscriptionFeatureItemView preferredWidthForTitle:title]; + [baseWidths addObject:@(w)]; + baseTotalWidth += w; + if (i > 0) { baseTotalWidth += kKBFeatureMarqueeItemSpacing; } + } + + NSArray *loopData = shouldLoop ? [self.items arrayByAddingObjectsFromArray:self.items] : self.items; + CGFloat totalWidth = shouldLoop ? (baseTotalWidth * 2 + kKBFeatureMarqueeItemSpacing) : baseTotalWidth; + + UIView *previous = nil; + for (NSInteger idx = 0; idx < loopData.count; idx++) { + NSDictionary *info = loopData[(NSUInteger)idx]; + UIImage *img = [info[@"image"] isKindOfClass:UIImage.class] ? info[@"image"] : nil; + NSString *title = [info[@"title"] isKindOfClass:NSString.class] ? info[@"title"] : @""; + CGFloat width = baseWidths[(NSUInteger)(idx % baseCount)].doubleValue; + + KBKeyboardSubscriptionFeatureItemView *itemView = [[KBKeyboardSubscriptionFeatureItemView alloc] init]; + [itemView configureWithImage:(img ?: [UIImage new]) title:title]; + [self.contentView addSubview:itemView]; + + [itemView mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.bottom.equalTo(self.contentView); + make.width.mas_equalTo(width); + if (previous) { + make.left.equalTo(previous.mas_right).offset(kKBFeatureMarqueeItemSpacing); + } else { + make.left.equalTo(self.contentView.mas_left); + } + }]; + previous = itemView; + } + + [self.contentView mas_remakeConstraints:^(MASConstraintMaker *make) { + make.top.bottom.equalTo(self.scrollView); + make.left.equalTo(self.scrollView); + make.height.equalTo(self.scrollView); + if (previous) { + make.right.equalTo(previous.mas_right); + } else { + make.right.equalTo(self.scrollView); + } + }]; + + CGFloat minWidth = CGRectGetWidth(self.bounds); + if (minWidth <= 0) { minWidth = 1; } + CGFloat height = CGRectGetHeight(self.bounds); + if (height <= 0) { height = 48; } + + CGFloat contentWidth = totalWidth; + if (contentWidth <= minWidth) { + contentWidth = minWidth; + self.loopWidth = 0; + [self stopTicker]; + self.scrollView.contentOffset = CGPointZero; + } else { + self.loopWidth = shouldLoop ? (baseTotalWidth + kKBFeatureMarqueeItemSpacing) : 0; + [self startTickerIfNeeded]; + } + self.scrollView.contentSize = CGSizeMake(contentWidth, height); +} + +#pragma mark - Ticker + +- (void)startTickerIfNeeded { + if (self.displayLink || self.loopWidth <= 0) { return; } + self.displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(handleTick)]; + self.displayLink.preferredFramesPerSecond = 60; + [self.displayLink addToRunLoop:[NSRunLoop mainRunLoop] forMode:NSRunLoopCommonModes]; +} + +- (void)stopTicker { + [self.displayLink invalidate]; + self.displayLink = nil; +} + +- (void)handleTick { + if (self.loopWidth <= 0) { return; } + CGFloat nextX = self.scrollView.contentOffset.x + kKBFeatureMarqueeSpeedPerFrame; + if (nextX >= self.loopWidth) { + nextX -= self.loopWidth; + } + self.scrollView.contentOffset = CGPointMake(nextX, 0); +} + +#pragma mark - Lazy + +- (UIScrollView *)scrollView { + if (!_scrollView) { + _scrollView = [[UIScrollView alloc] init]; + _scrollView.showsHorizontalScrollIndicator = NO; + _scrollView.scrollEnabled = NO; + _scrollView.clipsToBounds = YES; + } + return _scrollView; +} + +- (UIView *)contentView { + if (!_contentView) { + _contentView = [[UIView alloc] init]; + } + return _contentView; +} + +@end + diff --git a/CustomKeyboard/View/KBKeyboardSubscriptionOptionCell.h b/CustomKeyboard/View/KBKeyboardSubscriptionOptionCell.h new file mode 100644 index 0000000..915d0e7 --- /dev/null +++ b/CustomKeyboard/View/KBKeyboardSubscriptionOptionCell.h @@ -0,0 +1,18 @@ +// +// KBKeyboardSubscriptionOptionCell.h +// CustomKeyboard +// +// Created by Mac on 2025/12/17. +// + +#import +#import "KBKeyboardSubscriptionProduct.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface KBKeyboardSubscriptionOptionCell : UICollectionViewCell +- (void)configureWithProduct:(KBKeyboardSubscriptionProduct *)product; +- (void)applySelected:(BOOL)selected animated:(BOOL)animated; +@end + +NS_ASSUME_NONNULL_END diff --git a/CustomKeyboard/View/KBKeyboardSubscriptionOptionCell.m b/CustomKeyboard/View/KBKeyboardSubscriptionOptionCell.m new file mode 100644 index 0000000..f205121 --- /dev/null +++ b/CustomKeyboard/View/KBKeyboardSubscriptionOptionCell.m @@ -0,0 +1,163 @@ +// +// KBKeyboardSubscriptionOptionCell.m +// CustomKeyboard +// +// Created by Mac on 2025/12/17. +// + +#import "KBKeyboardSubscriptionOptionCell.h" +@interface KBKeyboardSubscriptionOptionCell() +@property (nonatomic, strong) UIView *cardView; +@property (nonatomic, strong) UILabel *titleLabel; +@property (nonatomic, strong) UILabel *priceLabel; +@property (nonatomic, strong) UILabel *strikeLabel; +@property (nonatomic, strong) UIView *checkBadge; +@property (nonatomic, strong) UILabel *checkLabel; +@end +@implementation KBKeyboardSubscriptionOptionCell +- (instancetype)initWithFrame:(CGRect)frame { + if (self = [super initWithFrame:frame]) { + self.contentView.backgroundColor = [UIColor clearColor]; + [self.contentView addSubview:self.cardView]; + [self.cardView addSubview:self.titleLabel]; + [self.cardView addSubview:self.priceLabel]; + [self.cardView addSubview:self.strikeLabel]; + [self.cardView addSubview:self.checkBadge]; + [self.checkBadge addSubview:self.checkLabel]; + + [self.cardView mas_makeConstraints:^(MASConstraintMaker *make) { +// make.edges.equalTo(self.contentView); + make.left.right.top.equalTo(self.contentView); + make.bottom.equalTo(self.contentView).offset(-10); + }]; + + [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.equalTo(self.cardView.mas_top).offset(4); + make.left.equalTo(self.cardView.mas_left).offset(10); + make.right.equalTo(self.cardView.mas_right).offset(-10); + }]; + + [self.priceLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.equalTo(self.titleLabel.mas_left); + make.top.equalTo(self.titleLabel.mas_bottom).offset(8); + }]; + + [self.strikeLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.equalTo(self.priceLabel.mas_right).offset(5); + make.centerY.equalTo(self.priceLabel); + }]; + + [self.checkBadge mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerX.equalTo(self.cardView.mas_centerX); + make.bottom.equalTo(self.cardView.mas_bottom).offset(10); + make.width.height.mas_equalTo(20); + }]; + + [self.checkLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.center.equalTo(self.checkBadge); + }]; + } + return self; +} + +- (void)prepareForReuse { + [super prepareForReuse]; + self.titleLabel.text = @""; + self.priceLabel.text = @""; + self.strikeLabel.attributedText = nil; + self.strikeLabel.hidden = YES; + [self applySelected:NO animated:NO]; +} + +- (void)configureWithProduct:(KBKeyboardSubscriptionProduct *)product { + if (!product) { return; } + self.titleLabel.text = [product displayTitle]; + self.priceLabel.text = [product priceDisplayText]; + NSString *strike = [product strikePriceDisplayText]; + if (strike.length > 0) { + NSDictionary *attr = @{ + NSStrikethroughStyleAttributeName: @(NSUnderlineStyleSingle), + NSForegroundColorAttributeName: [UIColor colorWithHex:0xCCCCCC], + NSFontAttributeName: [UIFont systemFontOfSize:14] + }; + self.strikeLabel.attributedText = [[NSAttributedString alloc] initWithString:strike attributes:attr]; + self.strikeLabel.hidden = NO; + } else { + self.strikeLabel.attributedText = nil; + self.strikeLabel.hidden = YES; + } +} + +- (void)applySelected:(BOOL)selected animated:(BOOL)animated { + void (^changes)(void) = ^{ + self.cardView.layer.borderColor = selected ? [UIColor colorWithHex:0x02BEAC].CGColor : [[UIColor blackColor] colorWithAlphaComponent:0.12].CGColor; + self.cardView.layer.borderWidth = selected ? 2.0 : 1.0; + self.checkBadge.backgroundColor = selected ? [UIColor colorWithHex:0x02BEAC] : [[UIColor blackColor] colorWithAlphaComponent:0.15]; + self.checkLabel.textColor = [UIColor whiteColor]; + }; + if (animated) { + [UIView animateWithDuration:0.18 animations:changes]; + } else { + changes(); + } +} + +- (UIView *)cardView { + if (!_cardView) { + _cardView = [[UIView alloc] init]; + _cardView.backgroundColor = [UIColor colorWithWhite:1 alpha:0.96]; + _cardView.layer.cornerRadius = 20; + _cardView.layer.borderWidth = 1.0; + _cardView.layer.borderColor = [[UIColor blackColor] colorWithAlphaComponent:0.12].CGColor; + } + return _cardView; +} + +- (UILabel *)titleLabel { + if (!_titleLabel) { + _titleLabel = [[UILabel alloc] init]; + _titleLabel.font = [UIFont systemFontOfSize:13 weight:UIFontWeightSemibold]; + _titleLabel.numberOfLines = 2; + _titleLabel.textColor = [UIColor colorWithHex:0x1B1F1A]; + } + return _titleLabel; +} + +- (UILabel *)priceLabel { + if (!_priceLabel) { + _priceLabel = [[UILabel alloc] init]; + _priceLabel.font = [UIFont systemFontOfSize:20 weight:UIFontWeightBold]; + _priceLabel.textColor = [UIColor colorWithHex:0x1B1F1A]; + } + return _priceLabel; +} + +- (UILabel *)strikeLabel { + if (!_strikeLabel) { + _strikeLabel = [[UILabel alloc] init]; + _strikeLabel.textColor = [UIColor colorWithHex:0xCCCCCC]; + _strikeLabel.hidden = YES; + } + return _strikeLabel; +} + +- (UIView *)checkBadge { + if (!_checkBadge) { + _checkBadge = [[UIView alloc] init]; + _checkBadge.layer.cornerRadius = 10; + _checkBadge.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.15]; + } + return _checkBadge; +} + +- (UILabel *)checkLabel { + if (!_checkLabel) { + _checkLabel = [[UILabel alloc] init]; + _checkLabel.text = @"✓"; + _checkLabel.font = [UIFont systemFontOfSize:12 weight:UIFontWeightBold]; + _checkLabel.textColor = [UIColor whiteColor]; + _checkLabel.textAlignment = NSTextAlignmentCenter; + } + return _checkLabel; +} +@end diff --git a/CustomKeyboard/View/KBKeyboardSubscriptionView.m b/CustomKeyboard/View/KBKeyboardSubscriptionView.m index 8c57468..cd877f1 100644 --- a/CustomKeyboard/View/KBKeyboardSubscriptionView.m +++ b/CustomKeyboard/View/KBKeyboardSubscriptionView.m @@ -7,34 +7,27 @@ #import "KBKeyboardSubscriptionProduct.h" #import "KBNetworkManager.h" #import "KBFullAccessManager.h" -#import "KBKeyboardSubscriptionFeatureItemView.h" +#import "KBKeyboardSubscriptionFeatureMarqueeView.h" +#import "KBKeyboardSubscriptionOptionCell.h" + #import static NSString * const kKBKeyboardSubscriptionCellId = @"kKBKeyboardSubscriptionCellId"; -@interface KBKeyboardSubscriptionOptionCell : UICollectionViewCell -- (void)configureWithProduct:(KBKeyboardSubscriptionProduct *)product; -- (void)applySelected:(BOOL)selected animated:(BOOL)animated; -@end - @interface KBKeyboardSubscriptionView () @property (nonatomic, strong) UIImageView *cardView; @property (nonatomic, strong) UIButton *closeButton; -@property (nonatomic, strong) UIScrollView *featureScrollView; -@property (nonatomic, strong) UIView *featureContentView; +@property (nonatomic, strong) KBKeyboardSubscriptionFeatureMarqueeView *featureMarqueeView; @property (nonatomic, strong) UICollectionView *collectionView; @property (nonatomic, strong) UIButton *purchaseButton; @property (nonatomic, strong) UILabel *agreementLabel; @property (nonatomic, strong) UIButton *agreementButton; @property (nonatomic, strong) UIActivityIndicatorView *loadingIndicator; @property (nonatomic, strong) UILabel *emptyLabel; -@property (nonatomic, copy) NSArray *featureItems; @property (nonatomic, copy) NSArray *products; @property (nonatomic, assign) NSInteger selectedIndex; @property (nonatomic, assign) BOOL didLoadOnce; @property (nonatomic, assign, getter=isLoading) BOOL loading; -@property (nonatomic, strong) CADisplayLink *featureDisplayLink; -@property (nonatomic, assign) CGFloat featureLoopWidth; @end @implementation KBKeyboardSubscriptionView @@ -49,35 +42,6 @@ static NSString * const kKBKeyboardSubscriptionCellId = @"kKBKeyboardSubscriptio return self; } -- (void)dealloc { - [self.featureDisplayLink invalidate]; -} - -- (void)layoutSubviews { - [super layoutSubviews]; - [self startFeatureTickerIfNeeded]; -} - -- (void)didMoveToWindow { - [super didMoveToWindow]; - if (self.window) { - [self startFeatureTickerIfNeeded]; - } else { - [self stopFeatureTicker]; - } -} - -- (void)setHidden:(BOOL)hidden { - BOOL oldHidden = self.isHidden; - [super setHidden:hidden]; - if (oldHidden == hidden) { return; } - if (hidden) { - [self stopFeatureTicker]; - } else if (self.window) { - [self startFeatureTickerIfNeeded]; - } -} - #pragma mark - Public - (void)refreshProductsIfNeeded { @@ -102,7 +66,7 @@ static NSString * const kKBKeyboardSubscriptionCellId = @"kKBKeyboardSubscriptio }]; [self.cardView addSubview:self.closeButton]; - [self.cardView addSubview:self.featureScrollView]; + [self.cardView addSubview:self.featureMarqueeView]; [self.cardView addSubview:self.collectionView]; [self.cardView addSubview:self.purchaseButton]; [self.cardView addSubview:self.agreementLabel]; @@ -116,7 +80,7 @@ static NSString * const kKBKeyboardSubscriptionCellId = @"kKBKeyboardSubscriptio make.width.height.mas_equalTo(28); }]; - [self.featureScrollView mas_makeConstraints:^(MASConstraintMaker *make) { + [self.featureMarqueeView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(self.closeButton.mas_right).offset(5); make.centerY.equalTo(self.closeButton); make.right.equalTo(self.cardView.mas_right).offset(-12); @@ -124,28 +88,32 @@ static NSString * const kKBKeyboardSubscriptionCellId = @"kKBKeyboardSubscriptio }]; [self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.right.equalTo(self.featureScrollView); - make.top.equalTo(self.featureScrollView.mas_bottom).offset(10); - make.height.mas_equalTo(138); - }]; - - [self.agreementButton mas_makeConstraints:^(MASConstraintMaker *make) { - make.centerX.equalTo(self.cardView.mas_centerX); - make.bottom.equalTo(self.cardView.mas_bottom).offset(-14); - }]; - - [self.agreementLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.centerX.equalTo(self.cardView.mas_centerX); - make.bottom.equalTo(self.agreementButton.mas_top).offset(-4); + make.left.right.equalTo(self).inset(16); + make.top.equalTo(self.featureMarqueeView.mas_bottom).offset(0); + make.height.mas_equalTo(76); }]; [self.purchaseButton mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.equalTo(self.cardView.mas_left).offset(24); - make.right.equalTo(self.cardView.mas_right).offset(-24); + make.left.equalTo(self.cardView.mas_left).offset(16); + make.right.equalTo(self.cardView.mas_right).offset(-16); make.top.equalTo(self.collectionView.mas_bottom).offset(20); - make.bottom.equalTo(self.agreementLabel.mas_top).offset(-16); - make.height.mas_greaterThanOrEqualTo(@48); +// make.bottom.equalTo(self.agreementLabel.mas_top).offset(-16); + make.height.mas_greaterThanOrEqualTo(@45); }]; + + [self.agreementLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerX.equalTo(self.cardView.mas_centerX); + make.top.equalTo(self.purchaseButton.mas_bottom).offset(8); + }]; + + [self.agreementButton mas_makeConstraints:^(MASConstraintMaker *make) { + make.centerX.equalTo(self.cardView.mas_centerX); + make.top.equalTo(self.agreementLabel.mas_bottom).offset(4); + }]; + + + + [self.loadingIndicator mas_makeConstraints:^(MASConstraintMaker *make) { make.center.equalTo(self.collectionView); @@ -155,13 +123,6 @@ static NSString * const kKBKeyboardSubscriptionCellId = @"kKBKeyboardSubscriptio make.center.equalTo(self.collectionView); }]; - [self.featureScrollView addSubview:self.featureContentView]; - [self.featureContentView mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.bottom.equalTo(self.featureScrollView); - make.left.equalTo(self.featureScrollView); - make.height.equalTo(self.featureScrollView); - make.right.equalTo(self.featureScrollView); - }]; [self updatePurchaseButtonState]; } @@ -178,92 +139,7 @@ static NSString * const kKBKeyboardSubscriptionCellId = @"kKBKeyboardSubscriptio [UIImage imageNamed:@"home_chat_icon"] ?: [UIImage new], [UIImage imageNamed:@"home_emotion_icon"] ?: [UIImage new] ]; - NSMutableArray *items = [NSMutableArray array]; - [titles enumerateObjectsUsingBlock:^(NSString *obj, NSUInteger idx, BOOL *stop) { - UIImage *img = (idx < images.count) ? images[idx] : nil; - if (!obj) { obj = @""; } - if (!img) { img = [UIImage new]; } - [items addObject:@{@"title": obj, @"image": img}]; - }]; - self.featureItems = [items copy]; - [self rebuildFeatureBadges]; -} - -- (void)rebuildFeatureBadges { - [self.featureContentView.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)]; - if (self.featureItems.count == 0) { - self.featureScrollView.contentSize = CGSizeZero; - self.featureLoopWidth = 0; - [self stopFeatureTicker]; - return; - } - BOOL shouldLoop = (self.featureItems.count > 1); - CGFloat spacing = 12.0; - NSInteger baseCount = self.featureItems.count; - - NSMutableArray *baseWidths = [NSMutableArray arrayWithCapacity:baseCount]; - CGFloat baseTotalWidth = 0.0; - for (NSInteger i = 0; i < baseCount; i++) { - NSDictionary *info = self.featureItems[i]; - NSString *title = [info[@"title"] isKindOfClass:NSString.class] ? info[@"title"] : @""; - CGFloat width = [KBKeyboardSubscriptionFeatureItemView preferredWidthForTitle:title]; - [baseWidths addObject:@(width)]; - baseTotalWidth += width; - if (i > 0) { baseTotalWidth += spacing; } - } - - NSArray *loopData = shouldLoop ? [self.featureItems arrayByAddingObjectsFromArray:self.featureItems] : self.featureItems; - CGFloat totalWidth = shouldLoop ? (baseTotalWidth * 2 + spacing) : baseTotalWidth; - - UIView *previous = nil; - for (NSInteger idx = 0; idx < loopData.count; idx++) { - NSDictionary *info = loopData[idx]; - UIImage *img = [info[@"image"] isKindOfClass:UIImage.class] ? info[@"image"] : nil; - NSString *title = [info[@"title"] isKindOfClass:NSString.class] ? info[@"title"] : @""; - - CGFloat width = (baseCount > 0) ? baseWidths[(NSUInteger)(idx % baseCount)].doubleValue : 120.0; - KBKeyboardSubscriptionFeatureItemView *badge = [[KBKeyboardSubscriptionFeatureItemView alloc] init]; - [badge configureWithImage:(img ?: [UIImage new]) title:title]; - [self.featureContentView addSubview:badge]; - - [badge mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.bottom.equalTo(self.featureContentView); - make.width.mas_equalTo(width); - if (previous) { - make.left.equalTo(previous.mas_right).offset(spacing); - } else { - make.left.equalTo(self.featureContentView.mas_left); - } - }]; - previous = badge; - } - - __weak typeof(self) weakSelf = self; - [self.featureContentView mas_remakeConstraints:^(MASConstraintMaker *make) { - make.top.bottom.equalTo(weakSelf.featureScrollView); - make.left.equalTo(weakSelf.featureScrollView); - make.height.equalTo(weakSelf.featureScrollView); - if (previous) { - make.right.equalTo(previous.mas_right); - } else { - make.right.equalTo(weakSelf.featureScrollView); - } - }]; - CGFloat minWidth = CGRectGetWidth(self.featureScrollView.bounds); - if (minWidth <= 0) { minWidth = [UIScreen mainScreen].bounds.size.width - 24; } - CGFloat height = CGRectGetHeight(self.featureScrollView.bounds); - if (height <= 0) { height = 48; } - CGFloat contentWidth = totalWidth; - if (contentWidth <= minWidth) { - contentWidth = minWidth; - self.featureLoopWidth = 0; - [self stopFeatureTicker]; - self.featureScrollView.contentOffset = CGPointZero; - } else { - self.featureLoopWidth = shouldLoop ? (baseTotalWidth + spacing) : 0.0; - [self startFeatureTickerIfNeeded]; - } - self.featureScrollView.contentSize = CGSizeMake(contentWidth, height); + [self.featureMarqueeView configureWithTitles:titles images:images]; } #pragma mark - Actions @@ -361,29 +237,6 @@ static NSString * const kKBKeyboardSubscriptionCellId = @"kKBKeyboardSubscriptio self.purchaseButton.alpha = enabled ? 1.0 : 0.5; } -#pragma mark - Feature ticker - -- (void)startFeatureTickerIfNeeded { - if (self.featureDisplayLink || self.featureLoopWidth <= 0) { return; } - self.featureDisplayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(handleFeatureTick)]; - self.featureDisplayLink.preferredFramesPerSecond = 60; - [self.featureDisplayLink addToRunLoop:[NSRunLoop mainRunLoop] forMode:NSRunLoopCommonModes]; -} - -- (void)stopFeatureTicker { - [self.featureDisplayLink invalidate]; - self.featureDisplayLink = nil; -} - -- (void)handleFeatureTick { - if (self.featureLoopWidth <= 0) { return; } - CGFloat nextX = self.featureScrollView.contentOffset.x + 0.35f; - if (nextX >= self.featureLoopWidth) { - nextX -= self.featureLoopWidth; - } - self.featureScrollView.contentOffset = CGPointMake(nextX, 0); -} - #pragma mark - UICollectionView DataSource - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section { @@ -422,8 +275,8 @@ static NSString * const kKBKeyboardSubscriptionCellId = @"kKBKeyboardSubscriptio #pragma mark - Layout - (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath { - CGFloat width = MIN(MAX(collectionView.bounds.size.width * 0.56, 150), 220); - return CGSizeMake(width, collectionView.bounds.size.height - 12); +// CGFloat width = MIN(MAX(collectionView.bounds.size.width * 0.56, 150), 220); + return CGSizeMake(160, collectionView.bounds.size.height); } - (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout minimumLineSpacingForSectionAtIndex:(NSInteger)section { @@ -431,7 +284,7 @@ static NSString * const kKBKeyboardSubscriptionCellId = @"kKBKeyboardSubscriptio } - (UIEdgeInsets)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout insetForSectionAtIndex:(NSInteger)section { - return UIEdgeInsetsMake(6, 4, 6, 4); + return UIEdgeInsetsMake(0, 0, 0, 0); } #pragma mark - Lazy @@ -439,8 +292,8 @@ static NSString * const kKBKeyboardSubscriptionCellId = @"kKBKeyboardSubscriptio - (UIImageView *)cardView { if (!_cardView) { _cardView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"keybord_bg_icon"]]; - _cardView.layer.cornerRadius = 20; - _cardView.layer.masksToBounds = YES; +// _cardView.layer.cornerRadius = 20; +// _cardView.layer.masksToBounds = YES; _cardView.userInteractionEnabled = YES; _cardView.contentMode = UIViewContentModeScaleAspectFill; } @@ -461,22 +314,11 @@ static NSString * const kKBKeyboardSubscriptionCellId = @"kKBKeyboardSubscriptio return _closeButton; } -- (UIScrollView *)featureScrollView { - if (!_featureScrollView) { - _featureScrollView = [[UIScrollView alloc] init]; - _featureScrollView.showsHorizontalScrollIndicator = NO; - _featureScrollView.scrollEnabled = NO; - _featureScrollView.clipsToBounds = YES; - _featureScrollView.layer.cornerRadius = 26; +- (KBKeyboardSubscriptionFeatureMarqueeView *)featureMarqueeView { + if (!_featureMarqueeView) { + _featureMarqueeView = [[KBKeyboardSubscriptionFeatureMarqueeView alloc] init]; } - return _featureScrollView; -} - -- (UIView *)featureContentView { - if (!_featureContentView) { - _featureContentView = [[UIView alloc] init]; - } - return _featureContentView; + return _featureMarqueeView; } - (UICollectionView *)collectionView { @@ -560,160 +402,3 @@ static NSString * const kKBKeyboardSubscriptionCellId = @"kKBKeyboardSubscriptio @end -#pragma mark - Cell - -@interface KBKeyboardSubscriptionOptionCell () -@property (nonatomic, strong) UIView *cardView; -@property (nonatomic, strong) UILabel *titleLabel; -@property (nonatomic, strong) UILabel *priceLabel; -@property (nonatomic, strong) UILabel *strikeLabel; -@property (nonatomic, strong) UIView *checkBadge; -@property (nonatomic, strong) UILabel *checkLabel; -@end - -@implementation KBKeyboardSubscriptionOptionCell - -- (instancetype)initWithFrame:(CGRect)frame { - if (self = [super initWithFrame:frame]) { - self.contentView.backgroundColor = [UIColor clearColor]; - [self.contentView addSubview:self.cardView]; - [self.cardView addSubview:self.titleLabel]; - [self.cardView addSubview:self.priceLabel]; - [self.cardView addSubview:self.strikeLabel]; - [self.cardView addSubview:self.checkBadge]; - [self.checkBadge addSubview:self.checkLabel]; - - [self.cardView mas_makeConstraints:^(MASConstraintMaker *make) { - make.edges.equalTo(self.contentView); - }]; - - [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.top.equalTo(self.cardView.mas_top).offset(12); - make.left.equalTo(self.cardView.mas_left).offset(14); - make.right.equalTo(self.cardView.mas_right).offset(-14); - }]; - - [self.priceLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.equalTo(self.titleLabel.mas_left); - make.top.equalTo(self.titleLabel.mas_bottom).offset(10); - }]; - - [self.strikeLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.left.equalTo(self.priceLabel.mas_left); - make.top.equalTo(self.priceLabel.mas_bottom).offset(4); - }]; - - [self.checkBadge mas_makeConstraints:^(MASConstraintMaker *make) { - make.centerX.equalTo(self.cardView.mas_centerX); - make.bottom.equalTo(self.cardView.mas_bottom).offset(-8); - make.width.height.mas_equalTo(20); - }]; - - [self.checkLabel mas_makeConstraints:^(MASConstraintMaker *make) { - make.center.equalTo(self.checkBadge); - }]; - } - return self; -} - -- (void)prepareForReuse { - [super prepareForReuse]; - self.titleLabel.text = @""; - self.priceLabel.text = @""; - self.strikeLabel.attributedText = nil; - self.strikeLabel.hidden = YES; - [self applySelected:NO animated:NO]; -} - -- (void)configureWithProduct:(KBKeyboardSubscriptionProduct *)product { - if (!product) { return; } - self.titleLabel.text = [product displayTitle]; - self.priceLabel.text = [product priceDisplayText]; - NSString *strike = [product strikePriceDisplayText]; - if (strike.length > 0) { - NSDictionary *attr = @{ - NSStrikethroughStyleAttributeName: @(NSUnderlineStyleSingle), - NSForegroundColorAttributeName: [[UIColor blackColor] colorWithAlphaComponent:0.35], - NSFontAttributeName: [UIFont systemFontOfSize:12] - }; - self.strikeLabel.attributedText = [[NSAttributedString alloc] initWithString:strike attributes:attr]; - self.strikeLabel.hidden = NO; - } else { - self.strikeLabel.attributedText = nil; - self.strikeLabel.hidden = YES; - } -} - -- (void)applySelected:(BOOL)selected animated:(BOOL)animated { - void (^changes)(void) = ^{ - self.cardView.layer.borderColor = selected ? [UIColor colorWithHex:0x02BEAC].CGColor : [[UIColor blackColor] colorWithAlphaComponent:0.12].CGColor; - self.cardView.layer.borderWidth = selected ? 2.0 : 1.0; - self.checkBadge.backgroundColor = selected ? [UIColor colorWithHex:0x02BEAC] : [[UIColor blackColor] colorWithAlphaComponent:0.15]; - self.checkLabel.textColor = [UIColor whiteColor]; - }; - if (animated) { - [UIView animateWithDuration:0.18 animations:changes]; - } else { - changes(); - } -} - -- (UIView *)cardView { - if (!_cardView) { - _cardView = [[UIView alloc] init]; - _cardView.backgroundColor = [UIColor colorWithWhite:1 alpha:0.96]; - _cardView.layer.cornerRadius = 20; - _cardView.layer.borderWidth = 1.0; - _cardView.layer.borderColor = [[UIColor blackColor] colorWithAlphaComponent:0.12].CGColor; - } - return _cardView; -} - -- (UILabel *)titleLabel { - if (!_titleLabel) { - _titleLabel = [[UILabel alloc] init]; - _titleLabel.font = [UIFont systemFontOfSize:13 weight:UIFontWeightSemibold]; - _titleLabel.numberOfLines = 2; - _titleLabel.textColor = [UIColor colorWithHex:0x2F2F2F]; - } - return _titleLabel; -} - -- (UILabel *)priceLabel { - if (!_priceLabel) { - _priceLabel = [[UILabel alloc] init]; - _priceLabel.font = [UIFont systemFontOfSize:22 weight:UIFontWeightBold]; - _priceLabel.textColor = [UIColor colorWithHex:0x232323]; - } - return _priceLabel; -} - -- (UILabel *)strikeLabel { - if (!_strikeLabel) { - _strikeLabel = [[UILabel alloc] init]; - _strikeLabel.hidden = YES; - } - return _strikeLabel; -} - -- (UIView *)checkBadge { - if (!_checkBadge) { - _checkBadge = [[UIView alloc] init]; - _checkBadge.layer.cornerRadius = 10; - _checkBadge.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.15]; - } - return _checkBadge; -} - -- (UILabel *)checkLabel { - if (!_checkLabel) { - _checkLabel = [[UILabel alloc] init]; - _checkLabel.text = @"✓"; - _checkLabel.font = [UIFont systemFontOfSize:12 weight:UIFontWeightBold]; - _checkLabel.textColor = [UIColor whiteColor]; - _checkLabel.textAlignment = NSTextAlignmentCenter; - } - return _checkLabel; -} - -@end diff --git a/keyBoard.xcodeproj/project.pbxproj b/keyBoard.xcodeproj/project.pbxproj index 6d8dc0b..bcbf8a9 100644 --- a/keyBoard.xcodeproj/project.pbxproj +++ b/keyBoard.xcodeproj/project.pbxproj @@ -47,6 +47,7 @@ 0450AC162EF11E4400B6AF06 /* StoreKitServiceDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0450ABFD2EF11E4400B6AF06 /* StoreKitServiceDelegate.swift */; }; 0450AC172EF11E4400B6AF06 /* StoreKitState.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0450AC032EF11E4400B6AF06 /* StoreKitState.swift */; }; 0450AC1B2EF11E4400B6AF06 /* KBStoreKitBridge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0450AC1A2EF11E4400B6AF06 /* KBStoreKitBridge.swift */; }; + 0450AC4A2EF2C3ED00B6AF06 /* KBKeyboardSubscriptionOptionCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 0450AC492EF2C3ED00B6AF06 /* KBKeyboardSubscriptionOptionCell.m */; }; 0459D1B42EBA284C00F2D189 /* KBSkinCenterVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 0459D1B32EBA284C00F2D189 /* KBSkinCenterVC.m */; }; 0459D1B72EBA287900F2D189 /* KBSkinManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 0459D1B62EBA287900F2D189 /* KBSkinManager.m */; }; 0459D1B82EBA287900F2D189 /* KBSkinManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 0459D1B62EBA287900F2D189 /* KBSkinManager.m */; }; @@ -198,6 +199,10 @@ 04FEDAA12EEDB00100123456 /* KBEmojiDataProvider.m in Sources */ = {isa = PBXBuildFile; fileRef = 04FEDAA02EEDB00100123456 /* KBEmojiDataProvider.m */; }; 04FEDAB32EEDB05000123456 /* KBEmojiPanelView.m in Sources */ = {isa = PBXBuildFile; fileRef = 04FEDAB22EEDB05000123456 /* KBEmojiPanelView.m */; }; 04FEDB032EFE000000123456 /* KBEmojiBottomBarView.m in Sources */ = {isa = PBXBuildFile; fileRef = 04FEDB022EFE000000123456 /* KBEmojiBottomBarView.m */; }; + 04FEDC122F00010000999999 /* KBKeyboardSubscriptionView.m in Sources */ = {isa = PBXBuildFile; fileRef = 04FEDC112F00010000999999 /* KBKeyboardSubscriptionView.m */; }; + 04FEDC222F00020000999999 /* KBKeyboardSubscriptionProduct.m in Sources */ = {isa = PBXBuildFile; fileRef = 04FEDC212F00020000999999 /* KBKeyboardSubscriptionProduct.m */; }; + 04FEDC322F00030000999999 /* KBKeyboardSubscriptionFeatureItemView.m in Sources */ = {isa = PBXBuildFile; fileRef = 04FEDC312F00030000999999 /* KBKeyboardSubscriptionFeatureItemView.m */; }; + 04FEDC422F00040000999999 /* KBKeyboardSubscriptionFeatureMarqueeView.m in Sources */ = {isa = PBXBuildFile; fileRef = 04FEDC412F00040000999999 /* KBKeyboardSubscriptionFeatureMarqueeView.m */; }; 471CAD3574798685B72ADD55 /* KBMyTheme.m in Sources */ = {isa = PBXBuildFile; fileRef = 180D662EC4DB3A7FFF83FF18 /* KBMyTheme.m */; }; 49B63DBAEE9076C591E13D68 /* KBShopThemeTagModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E2A844CD2D8584596DBE6316 /* KBShopThemeTagModel.m */; }; 550CB2630FA4A7B4B9782EFA /* KBMyTheme.m in Sources */ = {isa = PBXBuildFile; fileRef = 180D662EC4DB3A7FFF83FF18 /* KBMyTheme.m */; }; @@ -214,9 +219,6 @@ A1B2E1022EBC7AAA00000001 /* HomeHotCell.m in Sources */ = {isa = PBXBuildFile; fileRef = A1B2E0042EBC7AAA00000001 /* HomeHotCell.m */; }; EB72B60040437E3C0A4890FC /* KBShopThemeDetailModel.m in Sources */ = {isa = PBXBuildFile; fileRef = B9F60894E529C3EDAF6BAC3D /* KBShopThemeDetailModel.m */; }; ECC9EE02174D86E8D792472F /* Pods_keyBoard.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 967065BB5230E43F293B3AF9 /* Pods_keyBoard.framework */; }; - 04FEDC122F00010000999999 /* KBKeyboardSubscriptionView.m in Sources */ = {isa = PBXBuildFile; fileRef = 04FEDC112F00010000999999 /* KBKeyboardSubscriptionView.m */; }; - 04FEDC222F00020000999999 /* KBKeyboardSubscriptionProduct.m in Sources */ = {isa = PBXBuildFile; fileRef = 04FEDC212F00020000999999 /* KBKeyboardSubscriptionProduct.m */; }; - 04FEDC322F00030000999999 /* KBKeyboardSubscriptionFeatureItemView.m in Sources */ = {isa = PBXBuildFile; fileRef = 04FEDC312F00030000999999 /* KBKeyboardSubscriptionFeatureItemView.m */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -299,6 +301,8 @@ 0450AC062EF11E4400B6AF06 /* StoreKitDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StoreKitDelegate.swift; sourceTree = ""; }; 0450AC082EF11E4400B6AF06 /* StoreKitManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StoreKitManager.swift; sourceTree = ""; }; 0450AC1A2EF11E4400B6AF06 /* KBStoreKitBridge.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KBStoreKitBridge.swift; sourceTree = ""; }; + 0450AC482EF2C3ED00B6AF06 /* KBKeyboardSubscriptionOptionCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KBKeyboardSubscriptionOptionCell.h; sourceTree = ""; }; + 0450AC492EF2C3ED00B6AF06 /* KBKeyboardSubscriptionOptionCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KBKeyboardSubscriptionOptionCell.m; sourceTree = ""; }; 0459D1B22EBA284C00F2D189 /* KBSkinCenterVC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KBSkinCenterVC.h; sourceTree = ""; }; 0459D1B32EBA284C00F2D189 /* KBSkinCenterVC.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KBSkinCenterVC.m; sourceTree = ""; }; 0459D1B52EBA287900F2D189 /* KBSkinManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KBSkinManager.h; sourceTree = ""; }; @@ -522,8 +526,6 @@ 04FC953A2EAFAE56007BD342 /* KeyBoardPrefixHeader.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KeyBoardPrefixHeader.pch; sourceTree = ""; }; 04FC95642EB0546C007BD342 /* KBKey.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KBKey.h; sourceTree = ""; }; 04FC95652EB0546C007BD342 /* KBKey.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KBKey.m; sourceTree = ""; }; - 04FEDC202F00020000999999 /* KBKeyboardSubscriptionProduct.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KBKeyboardSubscriptionProduct.h; sourceTree = ""; }; - 04FEDC212F00020000999999 /* KBKeyboardSubscriptionProduct.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KBKeyboardSubscriptionProduct.m; sourceTree = ""; }; 04FC95682EB05497007BD342 /* KBKeyButton.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KBKeyButton.h; sourceTree = ""; }; 04FC95692EB05497007BD342 /* KBKeyButton.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KBKeyButton.m; sourceTree = ""; }; 04FC956B2EB054B7007BD342 /* KBKeyboardView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KBKeyboardView.h; sourceTree = ""; }; @@ -538,10 +540,6 @@ 04FC95782EB09BC8007BD342 /* KBKeyBoardMainView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KBKeyBoardMainView.m; sourceTree = ""; }; 04FC95B02EB0B2CC007BD342 /* KBSettingView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KBSettingView.h; sourceTree = ""; }; 04FC95B12EB0B2CC007BD342 /* KBSettingView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KBSettingView.m; sourceTree = ""; }; - 04FEDC102F00010000999999 /* KBKeyboardSubscriptionView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KBKeyboardSubscriptionView.h; sourceTree = ""; }; - 04FEDC112F00010000999999 /* KBKeyboardSubscriptionView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KBKeyboardSubscriptionView.m; sourceTree = ""; }; - 04FEDC302F00030000999999 /* KBKeyboardSubscriptionFeatureItemView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KBKeyboardSubscriptionFeatureItemView.h; sourceTree = ""; }; - 04FEDC312F00030000999999 /* KBKeyboardSubscriptionFeatureItemView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KBKeyboardSubscriptionFeatureItemView.m; sourceTree = ""; }; 04FC95C72EB1E4C9007BD342 /* BaseNavigationController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BaseNavigationController.h; sourceTree = ""; }; 04FC95C82EB1E4C9007BD342 /* BaseNavigationController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BaseNavigationController.m; sourceTree = ""; }; 04FC95CA2EB1E780007BD342 /* BaseTabBarController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BaseTabBarController.h; sourceTree = ""; }; @@ -582,6 +580,14 @@ 04FEDAB22EEDB05000123456 /* KBEmojiPanelView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KBEmojiPanelView.m; sourceTree = ""; }; 04FEDB012EFE000000123456 /* KBEmojiBottomBarView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KBEmojiBottomBarView.h; sourceTree = ""; }; 04FEDB022EFE000000123456 /* KBEmojiBottomBarView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KBEmojiBottomBarView.m; sourceTree = ""; }; + 04FEDC102F00010000999999 /* KBKeyboardSubscriptionView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KBKeyboardSubscriptionView.h; sourceTree = ""; }; + 04FEDC112F00010000999999 /* KBKeyboardSubscriptionView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KBKeyboardSubscriptionView.m; sourceTree = ""; }; + 04FEDC202F00020000999999 /* KBKeyboardSubscriptionProduct.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KBKeyboardSubscriptionProduct.h; sourceTree = ""; }; + 04FEDC212F00020000999999 /* KBKeyboardSubscriptionProduct.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KBKeyboardSubscriptionProduct.m; sourceTree = ""; }; + 04FEDC302F00030000999999 /* KBKeyboardSubscriptionFeatureItemView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KBKeyboardSubscriptionFeatureItemView.h; sourceTree = ""; }; + 04FEDC312F00030000999999 /* KBKeyboardSubscriptionFeatureItemView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KBKeyboardSubscriptionFeatureItemView.m; sourceTree = ""; }; + 04FEDC402F00040000999999 /* KBKeyboardSubscriptionFeatureMarqueeView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KBKeyboardSubscriptionFeatureMarqueeView.h; sourceTree = ""; }; + 04FEDC412F00040000999999 /* KBKeyboardSubscriptionFeatureMarqueeView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KBKeyboardSubscriptionFeatureMarqueeView.m; sourceTree = ""; }; 180D662EC4DB3A7FFF83FF18 /* KBMyTheme.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KBMyTheme.m; sourceTree = ""; }; 2C1092FB2B452F95B15D4263 /* Pods_CustomKeyboard.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_CustomKeyboard.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 35E2B1C590E060D912A4E7F4 /* KBShopThemeTagModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KBShopThemeTagModel.h; sourceTree = ""; }; @@ -1144,6 +1150,10 @@ 04FEDC112F00010000999999 /* KBKeyboardSubscriptionView.m */, 04FEDC302F00030000999999 /* KBKeyboardSubscriptionFeatureItemView.h */, 04FEDC312F00030000999999 /* KBKeyboardSubscriptionFeatureItemView.m */, + 04FEDC402F00040000999999 /* KBKeyboardSubscriptionFeatureMarqueeView.h */, + 04FEDC412F00040000999999 /* KBKeyboardSubscriptionFeatureMarqueeView.m */, + 0450AC482EF2C3ED00B6AF06 /* KBKeyboardSubscriptionOptionCell.h */, + 0450AC492EF2C3ED00B6AF06 /* KBKeyboardSubscriptionOptionCell.m */, 049FB22D2EC34EB900FAB05D /* KBStreamTextView.h */, 049FB22E2EC34EB900FAB05D /* KBStreamTextView.m */, 049FB23A2EC4766700FAB05D /* Function */, @@ -1828,6 +1838,7 @@ 0498BD862EE1BEC9006CC1D5 /* KBSignUtils.m in Sources */, 04791FFC2ED71D17004E8522 /* UIColor+Extension.m in Sources */, 049FB2322EC45A0000FAB05D /* KBStreamFetcher.m in Sources */, + 0450AC4A2EF2C3ED00B6AF06 /* KBKeyboardSubscriptionOptionCell.m in Sources */, 04A9FE0F2EB481100020DB6D /* KBHUD.m in Sources */, 04C6EADD2EAF8CEB0089C901 /* KBToolBar.m in Sources */, 04FC95792EB09BC8007BD342 /* KBKeyBoardMainView.m in Sources */, @@ -1849,6 +1860,7 @@ 04FC95B22EB0B2CC007BD342 /* KBSettingView.m in Sources */, 04FEDC122F00010000999999 /* KBKeyboardSubscriptionView.m in Sources */, 04FEDC322F00030000999999 /* KBKeyboardSubscriptionFeatureItemView.m in Sources */, + 04FEDC422F00040000999999 /* KBKeyboardSubscriptionFeatureMarqueeView.m in Sources */, 04791F8E2ED469C0004E8522 /* KBHostAppLauncher.m in Sources */, 049FB23B2EC4766700FAB05D /* KBFunctionTagListView.m in Sources */, 049FB23C2EC4766700FAB05D /* KBStreamOverlayView.m in Sources */,