引导UI修改

This commit is contained in:
2025-12-15 17:56:06 +08:00
parent a399af53b5
commit 9cafb0f70e
5 changed files with 73 additions and 29 deletions

View File

@@ -185,7 +185,7 @@
"Tap any conversation to paste, then try any reply style~" = "Tap any conversation to paste, then try any reply style~"; "Tap any conversation to paste, then try any reply style~" = "Tap any conversation to paste, then try any reply style~";
"What are you doing?" = "What are you doing?"; "What are you doing?" = "What are you doing?";
"I'm going to take a shower." = "I'm going to take a shower."; "I'm going to take a shower." = "I'm going to take a shower.";
"🎉 If you run into any other issues, tap Online Support to get help~" = "🎉 If you run into any other issues, tap Online Support to get help~"; "Welcome to use the [key of love] keyboard" = "Welcome to use the [key of love] keyboard";
"👋 Welcome to Key of Love Keyboard" = "👋 Welcome to Key of Love Keyboard"; "👋 Welcome to Key of Love Keyboard" = "👋 Welcome to Key of Love Keyboard";
// Payment & IAP // Payment & IAP

View File

@@ -6,7 +6,7 @@
#import "KBGuideKFCell.h" #import "KBGuideKFCell.h"
@interface KBGuideKFCell () @interface KBGuideKFCell ()
@property (nonatomic, strong) UIView *avatarView; // @property (nonatomic, strong) UIImageView *avatarImageView; //
@property (nonatomic, strong) UIView *bubbleView; // @property (nonatomic, strong) UIView *bubbleView; //
@property (nonatomic, strong) UILabel *contentLabel; // @property (nonatomic, strong) UILabel *contentLabel; //
@end @end
@@ -16,8 +16,8 @@
- (void)setupUI { - (void)setupUI {
self.contentView.backgroundColor = [UIColor colorWithWhite:0.96 alpha:1.0]; self.contentView.backgroundColor = [UIColor colorWithWhite:0.96 alpha:1.0];
[self.contentView addSubview:self.avatarView]; [self.contentView addSubview:self.avatarImageView];
[self.avatarView mas_makeConstraints:^(MASConstraintMaker *make) { [self.avatarImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.contentView).offset(16); make.left.equalTo(self.contentView).offset(16);
make.top.equalTo(self.contentView).offset(10); make.top.equalTo(self.contentView).offset(10);
make.width.height.mas_equalTo(36); make.width.height.mas_equalTo(36);
@@ -25,7 +25,7 @@
[self.contentView addSubview:self.bubbleView]; [self.contentView addSubview:self.bubbleView];
[self.bubbleView mas_makeConstraints:^(MASConstraintMaker *make) { [self.bubbleView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.avatarView.mas_right).offset(8); make.left.equalTo(self.avatarImageView.mas_right).offset(8);
make.top.equalTo(self.contentView).offset(8); make.top.equalTo(self.contentView).offset(8);
make.right.lessThanOrEqualTo(self.contentView).offset(-80); make.right.lessThanOrEqualTo(self.contentView).offset(-80);
make.bottom.equalTo(self.contentView).offset(-8); make.bottom.equalTo(self.contentView).offset(-8);
@@ -43,14 +43,14 @@
#pragma mark - Lazy #pragma mark - Lazy
- (UIView *)avatarView { - (UIImageView *)avatarImageView {
if (!_avatarView) { if (!_avatarImageView) {
_avatarView = [UIView new]; _avatarImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"App_icon"]];
_avatarView.backgroundColor = [UIColor colorWithRed:0.23 green:0.47 blue:0.96 alpha:1.0]; _avatarImageView.contentMode = UIViewContentModeScaleAspectFill;
_avatarView.layer.cornerRadius = 18; _avatarImageView.layer.cornerRadius = 18;
_avatarView.layer.masksToBounds = YES; _avatarImageView.layer.masksToBounds = YES;
} }
return _avatarView; return _avatarImageView;
} }
- (UIView *)bubbleView { - (UIView *)bubbleView {
@@ -74,4 +74,3 @@
} }
@end @end

View File

@@ -7,8 +7,8 @@
@interface KBGuideTopCell () @interface KBGuideTopCell ()
// // 使 App_icon
@property (nonatomic, strong) UIView *avatarView; @property (nonatomic, strong) UIImageView *avatarImageView;
// //
@property (nonatomic, strong) UIView *cardView; @property (nonatomic, strong) UIView *cardView;
// / // /
@@ -27,8 +27,8 @@
self.contentView.backgroundColor = [UIColor clearColor]; self.contentView.backgroundColor = [UIColor clearColor];
// //
[self.contentView addSubview:self.avatarView]; [self.contentView addSubview:self.avatarImageView];
[self.avatarView mas_makeConstraints:^(MASConstraintMaker *make) { [self.avatarImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.contentView).offset(16); make.left.equalTo(self.contentView).offset(16);
make.top.equalTo(self.contentView).offset(12); make.top.equalTo(self.contentView).offset(12);
make.width.height.mas_equalTo(36); make.width.height.mas_equalTo(36);
@@ -37,7 +37,7 @@
// //
[self.contentView addSubview:self.cardView]; [self.contentView addSubview:self.cardView];
[self.cardView mas_makeConstraints:^(MASConstraintMaker *make) { [self.cardView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(self.avatarView.mas_right).offset(8); make.left.equalTo(self.avatarImageView.mas_right).offset(8);
make.right.lessThanOrEqualTo(self.contentView).offset(-32); make.right.lessThanOrEqualTo(self.contentView).offset(-32);
make.top.equalTo(self.contentView).offset(8); make.top.equalTo(self.contentView).offset(8);
make.bottom.equalTo(self.contentView).offset(-8); make.bottom.equalTo(self.contentView).offset(-8);
@@ -77,14 +77,14 @@
#pragma mark - Lazy #pragma mark - Lazy
- (UIView *)avatarView { - (UIImageView *)avatarImageView {
if (!_avatarView) { if (!_avatarImageView) {
_avatarView = [UIView new]; _avatarImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"App_icon"]];
_avatarView.backgroundColor = [UIColor colorWithRed:0.23 green:0.47 blue:0.96 alpha:1.0]; _avatarImageView.contentMode = UIViewContentModeScaleAspectFill;
_avatarView.layer.cornerRadius = 18; _avatarImageView.layer.cornerRadius = 18;
_avatarView.layer.masksToBounds = YES; _avatarImageView.layer.masksToBounds = YES;
} }
return _avatarView; return _avatarImageView;
} }
- (UIView *)cardView { - (UIView *)cardView {

View File

@@ -4,8 +4,11 @@
// //
#import "KBGuideUserCell.h" #import "KBGuideUserCell.h"
#import "KBUserSessionManager.h"
#import "KBUser.h"
@interface KBGuideUserCell () @interface KBGuideUserCell ()
@property (nonatomic, strong) UIImageView *avatarImageView; //
@property (nonatomic, strong) UIView *bubbleView; // @property (nonatomic, strong) UIView *bubbleView; //
@property (nonatomic, strong) UILabel *contentLabel; @property (nonatomic, strong) UILabel *contentLabel;
@end @end
@@ -15,9 +18,16 @@
- (void)setupUI { - (void)setupUI {
self.contentView.backgroundColor = [UIColor colorWithWhite:0.96 alpha:1.0]; self.contentView.backgroundColor = [UIColor colorWithWhite:0.96 alpha:1.0];
[self.contentView addSubview:self.avatarImageView];
[self.avatarImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(self.contentView).offset(-16);
make.top.equalTo(self.contentView).offset(10);
make.width.height.mas_equalTo(36);
}];
[self.contentView addSubview:self.bubbleView]; [self.contentView addSubview:self.bubbleView];
[self.bubbleView mas_makeConstraints:^(MASConstraintMaker *make) { [self.bubbleView mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(self.contentView).offset(-16); make.right.equalTo(self.avatarImageView.mas_left).offset(-8);
make.top.equalTo(self.contentView).offset(8); make.top.equalTo(self.contentView).offset(8);
make.left.greaterThanOrEqualTo(self.contentView).offset(80); make.left.greaterThanOrEqualTo(self.contentView).offset(80);
make.bottom.equalTo(self.contentView).offset(-8); make.bottom.equalTo(self.contentView).offset(-8);
@@ -31,14 +41,50 @@
- (void)configText:(NSString *)text { - (void)configText:(NSString *)text {
self.contentLabel.text = text; self.contentLabel.text = text;
self.avatarImageView.image = [self kb_resolvedAvatarImage];
}
#pragma mark - Helpers
- (UIImage *)kb_resolvedAvatarImage {
UIImage *placeholder = [UIImage imageNamed:@"placeholder_icon"];
KBUserSessionManager *session = [KBUserSessionManager shared];
if (![session isLoggedIn]) {
return placeholder;
}
KBUser *user = session.currentUser;
if (!user) {
return placeholder;
}
switch (user.gender) {
case UserSexMan:
return [UIImage imageNamed:@"message_man_icon"] ?: placeholder;
case UserSexWeman:
return [UIImage imageNamed:@"message_nv_icon"] ?: placeholder;
default:
return placeholder;
}
} }
#pragma mark - Lazy #pragma mark - Lazy
- (UIImageView *)avatarImageView {
if (!_avatarImageView) {
_avatarImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"placeholder_icon"]];
_avatarImageView.contentMode = UIViewContentModeScaleAspectFill;
_avatarImageView.layer.cornerRadius = 18;
_avatarImageView.layer.masksToBounds = YES;
}
return _avatarImageView;
}
- (UIView *)bubbleView { - (UIView *)bubbleView {
if (!_bubbleView) { if (!_bubbleView) {
_bubbleView = [UIView new]; _bubbleView = [UIView new];
_bubbleView.backgroundColor = [UIColor colorWithRed:0.42 green:0.45 blue:0.98 alpha:1.0]; _bubbleView.backgroundColor = [UIColor colorWithHex:KBColorValue];
_bubbleView.layer.cornerRadius = 12; _bubbleView.layer.cornerRadius = 12;
_bubbleView.layer.masksToBounds = YES; _bubbleView.layer.masksToBounds = YES;
} }
@@ -57,4 +103,3 @@
} }
@end @end

View File

@@ -191,7 +191,7 @@ typedef NS_ENUM(NSInteger, KBGuideItemType) {
// 1. // 1.
[self.items addObject:@{ @"type": @(KBGuideItemTypeUser), @"text": text ?: @"" }]; [self.items addObject:@{ @"type": @(KBGuideItemTypeUser), @"text": text ?: @"" }];
// 2. // 2.
NSString *reply = KBLocalized(@"🎉 If you run into any other issues, tap Online Support to get help~"); NSString *reply = KBLocalized(@"Welcome to use the [key of love] keyboard");
[self.items addObject:@{ @"type": @(KBGuideItemTypeKF), @"text": reply }]; [self.items addObject:@{ @"type": @(KBGuideItemTypeKF), @"text": reply }];
// //