|
@@ -39,7 +39,7 @@
|
|
|
|
|
|
#import "LEETheme.h"
|
|
|
|
|
|
-const CGFloat contentLabelFontSize = 15;
|
|
|
+const CGFloat contentLabelFontSize = 14;
|
|
|
CGFloat maxContentLabelHeight = 0; // 根据具体font而定
|
|
|
|
|
|
NSString *const kSDTimeLineCellOperationButtonClickedNotification = @"SDTimeLineCellOperationButtonClickedNotification";
|
|
@@ -54,6 +54,8 @@ NSString *const kSDTimeLineCellOperationButtonClickedNotification = @"SDTimeLine
|
|
|
UILabel *_timeLabel;
|
|
|
UIButton *_moreButton;
|
|
|
UIButton *_operationButton;
|
|
|
+ UIButton *_operationLikeButton;
|
|
|
+ UIButton *_operationCommentButton;
|
|
|
SDTimeLineCellCommentView *_commentView;
|
|
|
SDTimeLineCellOperationMenu *_operationMenu;
|
|
|
}
|
|
@@ -81,8 +83,8 @@ NSString *const kSDTimeLineCellOperationButtonClickedNotification = @"SDTimeLine
|
|
|
_iconView = [UIImageView new];
|
|
|
|
|
|
_nameLable = [UILabel new];
|
|
|
- _nameLable.font = [UIFont systemFontOfSize:14];
|
|
|
- _nameLable.textColor = [UIColor colorWithRed:(54 / 255.0) green:(71 / 255.0) blue:(121 / 255.0) alpha:0.9];
|
|
|
+ _nameLable.font = [UIFont boldSystemFontOfSize:16];
|
|
|
+ _nameLable.textColor = SLColor(@"#080F1B");
|
|
|
|
|
|
_contentLabel = [UILabel new];
|
|
|
_contentLabel.font = [UIFont systemFontOfSize:contentLabelFontSize];
|
|
@@ -98,54 +100,78 @@ NSString *const kSDTimeLineCellOperationButtonClickedNotification = @"SDTimeLine
|
|
|
_moreButton.titleLabel.font = [UIFont systemFontOfSize:14];
|
|
|
|
|
|
_operationButton = [UIButton new];
|
|
|
- [_operationButton setImage:[UIImage imageNamed:@"icon_lx_ts_ky"] forState:UIControlStateNormal];
|
|
|
+ [_operationButton setImage:[UIImage imageNamed:@"icon_moents_chat"] forState:UIControlStateNormal];
|
|
|
[_operationButton addTarget:self action:@selector(operationButtonClicked) forControlEvents:UIControlEventTouchUpInside];
|
|
|
|
|
|
- _picContainerView = [SDWeiXinPhotoContainerView new];
|
|
|
-
|
|
|
- _commentView = [SDTimeLineCellCommentView new];
|
|
|
-
|
|
|
- _timeLabel = [UILabel new];
|
|
|
- _timeLabel.font = [UIFont systemFontOfSize:13];
|
|
|
-
|
|
|
-
|
|
|
- _operationMenu = [SDTimeLineCellOperationMenu new];
|
|
|
- __weak typeof(self) weakSelf = self;
|
|
|
- [_operationMenu setLikeButtonClickedOperation:^{
|
|
|
+ _operationLikeButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
|
|
+ [_operationLikeButton setTitle:@"点赞" forState:UIControlStateNormal];
|
|
|
+ _operationLikeButton.titleLabel.font = [UIFont systemFontOfSize:10];
|
|
|
+ [_operationLikeButton setTitleColor:SLColor(@"#8E8E93") forState:UIControlStateNormal];
|
|
|
+ [_operationLikeButton setImage:[UIImage imageNamed:@"icon_heart"] forState:UIControlStateNormal];
|
|
|
+ WS(weakSelf);
|
|
|
+ [_operationLikeButton handleEvent:UIControlEventTouchUpInside withBlock:^{
|
|
|
if ([weakSelf.delegate respondsToSelector:@selector(didClickLikeButtonInCell:)]) {
|
|
|
[weakSelf.delegate didClickLikeButtonInCell:weakSelf];
|
|
|
}
|
|
|
}];
|
|
|
- [_operationMenu setCommentButtonClickedOperation:^{
|
|
|
+
|
|
|
+ _operationCommentButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
|
|
+ [_operationCommentButton setTitle:@"评论" forState:UIControlStateNormal];
|
|
|
+ _operationCommentButton.titleLabel.font = [UIFont systemFontOfSize:10];
|
|
|
+ [_operationCommentButton setTitleColor:SLColor(@"#8E8E93") forState:UIControlStateNormal];
|
|
|
+ [_operationCommentButton setImage:[UIImage imageNamed:@"icon_moents_chat"] forState:UIControlStateNormal];
|
|
|
+ [_operationCommentButton handleEvent:UIControlEventTouchUpInside withBlock:^{
|
|
|
if ([weakSelf.delegate respondsToSelector:@selector(didClickcCommentButtonInCell:)]) {
|
|
|
[weakSelf.delegate didClickcCommentButtonInCell:weakSelf];
|
|
|
}
|
|
|
}];
|
|
|
|
|
|
|
|
|
- NSArray *views = @[_iconView, _nameLable, _contentLabel, _moreButton, _picContainerView, _timeLabel, _operationButton, _operationMenu, _commentView];
|
|
|
+ _picContainerView = [SDWeiXinPhotoContainerView new];
|
|
|
+
|
|
|
+ _commentView = [SDTimeLineCellCommentView new];
|
|
|
+
|
|
|
+ _timeLabel = [UILabel new];
|
|
|
+ _timeLabel.textColor = SLColor(@"#8E8E93");
|
|
|
+ _timeLabel.font = [UIFont systemFontOfSize:10];
|
|
|
+
|
|
|
+
|
|
|
+// _operationMenu = [SDTimeLineCellOperationMenu new];
|
|
|
+// __weak typeof(self) weakSelf = self;
|
|
|
+// [_operationMenu setLikeButtonClickedOperation:^{
|
|
|
+// if ([weakSelf.delegate respondsToSelector:@selector(didClickLikeButtonInCell:)]) {
|
|
|
+// [weakSelf.delegate didClickLikeButtonInCell:weakSelf];
|
|
|
+// }
|
|
|
+// }];
|
|
|
+// [_operationMenu setCommentButtonClickedOperation:^{
|
|
|
+// if ([weakSelf.delegate respondsToSelector:@selector(didClickcCommentButtonInCell:)]) {
|
|
|
+// [weakSelf.delegate didClickcCommentButtonInCell:weakSelf];
|
|
|
+// }
|
|
|
+// }];
|
|
|
+
|
|
|
+
|
|
|
+ NSArray *views = @[_iconView, _nameLable, _contentLabel, _moreButton, _picContainerView, _timeLabel, _operationLikeButton, _operationCommentButton, _commentView];
|
|
|
|
|
|
[self.contentView sd_addSubviews:views];
|
|
|
|
|
|
UIView *contentView = self.contentView;
|
|
|
- CGFloat margin = 10;
|
|
|
|
|
|
_iconView.sd_layout
|
|
|
- .leftSpaceToView(contentView, margin)
|
|
|
- .topSpaceToView(contentView, margin + 5)
|
|
|
- .widthIs(40)
|
|
|
- .heightIs(40);
|
|
|
+ .leftSpaceToView(contentView, 14)
|
|
|
+ .topSpaceToView(contentView, 8)
|
|
|
+ .widthIs(48)
|
|
|
+ .heightIs(48);
|
|
|
|
|
|
_nameLable.sd_layout
|
|
|
- .leftSpaceToView(_iconView, margin)
|
|
|
+ .leftSpaceToView(_iconView, 12)
|
|
|
.topEqualToView(_iconView)
|
|
|
- .heightIs(18);
|
|
|
+ .heightIs(24);
|
|
|
[_nameLable setSingleLineAutoResizeWithMaxWidth:200];
|
|
|
|
|
|
_contentLabel.sd_layout
|
|
|
.leftEqualToView(_nameLable)
|
|
|
- .topSpaceToView(_nameLable, margin)
|
|
|
- .rightSpaceToView(contentView, margin)
|
|
|
+ .topSpaceToView(_nameLable, 3)
|
|
|
+ .rightSpaceToView(contentView, 12)
|
|
|
.autoHeightRatio(0);
|
|
|
|
|
|
// morebutton的高度在setmodel里面设置
|
|
@@ -160,26 +186,32 @@ NSString *const kSDTimeLineCellOperationButtonClickedNotification = @"SDTimeLine
|
|
|
|
|
|
_timeLabel.sd_layout
|
|
|
.leftEqualToView(_contentLabel)
|
|
|
- .topSpaceToView(_picContainerView, margin)
|
|
|
- .heightIs(15);
|
|
|
+ .topSpaceToView(_picContainerView, 8)
|
|
|
+ .heightIs(16);
|
|
|
[_timeLabel setSingleLineAutoResizeWithMaxWidth:200];
|
|
|
|
|
|
- _operationButton.sd_layout
|
|
|
- .rightSpaceToView(contentView, margin)
|
|
|
+ _operationLikeButton.sd_layout
|
|
|
+ .rightSpaceToView(contentView, 14)
|
|
|
.centerYEqualToView(_timeLabel)
|
|
|
- .heightIs(25)
|
|
|
- .widthIs(25);
|
|
|
+ .heightIs(16)
|
|
|
+ .widthIs(40);
|
|
|
+
|
|
|
+ _operationCommentButton.sd_layout
|
|
|
+ .rightSpaceToView(_operationLikeButton, 8)
|
|
|
+ .centerYEqualToView(_timeLabel)
|
|
|
+ .heightIs(16)
|
|
|
+ .widthIs(40);
|
|
|
|
|
|
_commentView.sd_layout
|
|
|
.leftEqualToView(_contentLabel)
|
|
|
- .rightSpaceToView(self.contentView, margin)
|
|
|
- .topSpaceToView(_timeLabel, margin); // 已经在内部实现高度自适应所以不需要再设置高度
|
|
|
-
|
|
|
- _operationMenu.sd_layout
|
|
|
- .rightSpaceToView(_operationButton, 0)
|
|
|
- .heightIs(36)
|
|
|
- .centerYEqualToView(_operationButton)
|
|
|
- .widthIs(0);
|
|
|
+ .rightSpaceToView(self.contentView, 14)
|
|
|
+ .topSpaceToView(_timeLabel, 4); // 已经在内部实现高度自适应所以不需要再设置高度
|
|
|
+
|
|
|
+// _operationMenu.sd_layout
|
|
|
+// .rightSpaceToView(_operationButton, 0)
|
|
|
+// .heightIs(36)
|
|
|
+// .centerYEqualToView(_operationButton)
|
|
|
+// .widthIs(0);
|
|
|
}
|
|
|
|
|
|
- (void)configTheme{
|
|
@@ -192,8 +224,8 @@ NSString *const kSDTimeLineCellOperationButtonClickedNotification = @"SDTimeLine
|
|
|
.LeeAddTextColor(NIGHT , [UIColor grayColor]);
|
|
|
|
|
|
_timeLabel.lee_theme
|
|
|
- .LeeAddTextColor(DAY , [UIColor lightGrayColor])
|
|
|
- .LeeAddTextColor(NIGHT , [UIColor grayColor]);
|
|
|
+ .LeeAddTextColor(DAY , SLColor(@"#8E8E93"))
|
|
|
+ .LeeAddTextColor(NIGHT , SLColor(@"#8E8E93"));
|
|
|
}
|
|
|
|
|
|
- (void)dealloc
|