Explorar el Código

[*] 腾讯IM UI调整完毕

yanxuyao hace 5 meses
padre
commit
56a5a92781

+ 2 - 2
MiMoLive/TUIKit/TUIChat/BaseCellData/Custom/MOUserLinkCellData.m

@@ -43,7 +43,7 @@
 - (CGSize)contentSize{
     //文字内容显示区域
     CGFloat viewWidth = [[UIScreen mainScreen] bounds].size.width - 64.0 - 12.0;
-    CGFloat contentWidth = viewWidth - 12.0 * 2.0;
+    CGFloat contentWidth = viewWidth - 12.0 * 2;
     
     //标题以上固定距离
     CGFloat titleTopSpacing = 8.0;
@@ -73,7 +73,7 @@
     
     CGFloat totalHeight = titleTopSpacing + 12.0 + titleHeight + 8.0 + contentHeight + 10.0 + 40.0 + bgViewBottomSpacing;
     
-    CGSize size = CGSizeMake(245, ceilf(totalHeight));
+    CGSize size = CGSizeMake(viewWidth, ceilf(totalHeight));
     return size;
 }
 

+ 2 - 0
MiMoLive/TUIKit/TUIChat/UI_Classic/Cell/Custom/MOUserLinkCell.h

@@ -12,6 +12,8 @@ NS_ASSUME_NONNULL_BEGIN
 
 @interface MOUserLinkCell : TUIBubbleMessageCell
 
+@property (nonatomic, strong) UIView *bgView;
+
 @property (nonatomic, strong) UILabel *titleLab;
 @property (nonatomic, strong) UILabel *contentLab;
 @property (nonatomic, strong) UIView *lineView;

+ 30 - 7
MiMoLive/TUIKit/TUIChat/UI_Classic/Cell/Custom/MOUserLinkCell.m

@@ -14,6 +14,10 @@
 - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
     self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
     if (self) {
+        
+        self.bubbleView.hidden = YES;
+        [self.container addSubview:self.bgView];
+        
         [self.container addSubview:self.titleLab];
         [self.container addSubview:self.contentLab];
         [self.container addSubview:self.lineView];
@@ -56,6 +60,17 @@
 }
 
 #pragma mark - Lazy
+
+- (UIView *)bgView{
+    if(!_bgView){
+        _bgView = [[UIView alloc] init];
+        _bgView.backgroundColor = [UIColor whiteColor];
+        _bgView.layer.cornerRadius = 16.0;
+        _bgView.layer.masksToBounds = YES;
+    }
+    return _bgView;
+}
+
 - (UILabel *)titleLab{
     if(!_titleLab){
         _titleLab = [UILabel new];
@@ -120,6 +135,10 @@
                                                    attributes:@{NSFontAttributeName : [MOUserLinkCell getTheFontWithSize:14.0 AndFontName:@"Inter-Regular"]}
                                                       context:nil];
     
+    [self.bgView mas_remakeConstraints:^(MASConstraintMaker *make) {
+        make.edges.equalTo(self.container);
+    }];
+    
     [self.titleLab mas_remakeConstraints:^(MASConstraintMaker *make) {
         make.top.mas_equalTo(12);
         make.leading.mas_equalTo(12);
@@ -138,29 +157,33 @@
         make.leading.mas_equalTo(12);
         make.trailing.mas_equalTo(0);
         make.height.mas_equalTo(0.5);
-        make.bottom.mas_equalTo(40);
+        make.bottom.mas_equalTo(-40);
     }];
     
     [self.detailTagLab mas_remakeConstraints:^(MASConstraintMaker *make) {
         make.leading.mas_equalTo(12);
         make.height.mas_equalTo(17);
-        make.bottom.mas_equalTo(12);
+        make.bottom.mas_equalTo(-12);
     }];
     
     [self.arrowImgView mas_remakeConstraints:^(MASConstraintMaker *make) {
         make.centerY.equalTo(self.detailTagLab);
-        make.trailing.mas_equalTo(12);
+        make.trailing.mas_equalTo(-12);
         make.width.height.mas_equalTo(14);
     }];
 }
 
+- (void)layoutSubviews {
+    [super layoutSubviews];
+}
+
 #pragma mark - TUIMessageCellProtocol
 + (CGSize)getContentSize:(TUIMessageCellData *)data {
     
     MOUserLinkCellData *evaluationCellData = (MOUserLinkCellData *)data;
     
-    CGFloat viewWidth = [[UIScreen mainScreen] bounds].size.width - 15.0 * 2.0;
-    CGFloat contentWidth = viewWidth - 10.0 * 2.0;
+    CGFloat viewWidth = [[UIScreen mainScreen] bounds].size.width - 64.0 - 12.0;
+    CGFloat contentWidth = viewWidth - 12.0 * 2;
     
     //标题以上固定距离
     CGFloat titleTopSpacing = 8.0;
@@ -188,9 +211,9 @@
     //30是bgView上下距离
     CGFloat bgViewBottomSpacing = 8.0;
     
-    CGFloat totalHeight = titleTopSpacing + titleHeight + 2.0 + contentHeight + bgViewBottomSpacing;
+    CGFloat totalHeight = titleTopSpacing + 12.0 + titleHeight + 8.0 + contentHeight + 10.0 + 40.0 + bgViewBottomSpacing;
     
-    CGSize size = CGSizeMake(245, ceilf(totalHeight));
+    CGSize size = CGSizeMake(viewWidth, ceilf(totalHeight));
     return size;
 }
 

+ 2 - 0
MiMoLive/TUIKit/TUIChat/UI_Classic/Chat/TUIMessageCellConfig.m

@@ -81,6 +81,8 @@ static NSMutableDictionary *gCustomMessageInfoMap = nil;
     // ...
     
     [self registerCustomMessageCell:@"MOSystemNormalCell" messageCellData:@"MOSystemNormalCellData" forBusinessID:@"MOSystemNormalCell"];
+    [self registerCustomMessageCell:@"MOUserLinkCell" messageCellData:@"MOUserLinkCellData" forBusinessID:@"MOUserLinkCell"];
+    [self registerCustomMessageCell:@"MOUserNotificationCell" messageCellData:@"MOUserNotificationCellData" forBusinessID:@"MOUserNotificationCell"];
 }
 
 + (void)registerCustomMessageCell:(TUICellClassName)messageCellName