|
@@ -80,17 +80,20 @@ class SearchContentListCollectionCell: UICollectionViewCell {
|
|
|
make.left.equalToSuperview().offset(10)
|
|
|
make.size.equalTo(18)
|
|
|
}
|
|
|
- nameButton.snp.remakeConstraints { (make) in
|
|
|
- make.centerY.equalTo(avatarButton)
|
|
|
- make.left.equalTo(avatarButton.snp_right).offset(5)
|
|
|
- make.height.equalTo(18)
|
|
|
- }
|
|
|
+
|
|
|
likeBtn.snp.remakeConstraints { (make) in
|
|
|
make.centerY.equalTo(avatarButton)
|
|
|
make.right.equalTo(-13)
|
|
|
make.height.equalTo(18)
|
|
|
}
|
|
|
likeBtn.layoutButton(edgeInsetsStyle: ButtonEdgeInsetsStyle.left, imageTitleSpace: 5)
|
|
|
+
|
|
|
+ nameButton.snp.remakeConstraints { (make) in
|
|
|
+ make.centerY.equalTo(avatarButton)
|
|
|
+ make.left.equalTo(avatarButton.snp_right).offset(5)
|
|
|
+ make.height.equalTo(18)
|
|
|
+ make.right.equalTo(likeBtn.snp_left).offset(-5)
|
|
|
+ }
|
|
|
praiseAnimationView.snp.makeConstraints { (make) in
|
|
|
make.edges.equalToSuperview()
|
|
|
}
|
|
@@ -141,6 +144,7 @@ class SearchContentListCollectionCell: UICollectionViewCell {
|
|
|
nameButton.setTitleColor(k262626Color, for: UIControl.State.normal)
|
|
|
nameButton.titleLabel?.font = kRegularFont12
|
|
|
nameButton.contentHorizontalAlignment = .left
|
|
|
+ nameButton.titleLabel?.lineBreakMode = .byTruncatingTail
|
|
|
nameButton.rx.tap.subscribe(onNext: {
|
|
|
[weak self] (data) in
|
|
|
if let userClosure = self?.userClosure {
|
|
@@ -189,9 +193,9 @@ class SearchContentListCollectionCell: UICollectionViewCell {
|
|
|
contentImageView.kf.setImage(with: kURLImage(name: communityPostDataModel?.img ?? ""), placeholder: kImage(name: "pic_preload"))
|
|
|
titleLabel.text = communityPostDataModel?.title
|
|
|
if communityPostDataModel?.title == "" || communityPostDataModel?.title == nil {
|
|
|
- titleLabel.text = communityPostDataModel?.content
|
|
|
+ titleLabel.text = communityPostDataModel?.content?.replacingOccurrences(of: "\n", with: "").replacingOccurrences(of: "\r", with: "")
|
|
|
}else {
|
|
|
- titleLabel.text = communityPostDataModel?.title
|
|
|
+ titleLabel.text = communityPostDataModel?.title?.replacingOccurrences(of: "\n", with: "").replacingOccurrences(of: "\r", with: "")
|
|
|
}
|
|
|
avatarButton.kf.setImage(with: kURLImage(name: communityPostDataModel?.avatar ?? ""), for: UIControl.State.normal, placeholder: kImage(name: "default_avatar"))
|
|
|
likeBtn.setTitle("\(communityPostDataModel?.praiseCount ?? 0)", for: UIControl.State.normal)
|
|
@@ -200,8 +204,21 @@ class SearchContentListCollectionCell: UICollectionViewCell {
|
|
|
}else {
|
|
|
likeBtn.isSelected = true
|
|
|
}
|
|
|
- likeBtn.layoutButton(edgeInsetsStyle: ButtonEdgeInsetsStyle.left, imageTitleSpace: 5)
|
|
|
+
|
|
|
+
|
|
|
nameButton.setTitle(communityPostDataModel?.username, for: UIControl.State.normal)
|
|
|
+ nameButton.snp.remakeConstraints { (make) in
|
|
|
+ make.centerY.equalTo(avatarButton)
|
|
|
+ make.left.equalTo(avatarButton.snp_right).offset(5)
|
|
|
+ make.height.equalTo(18)
|
|
|
+ make.right.lessThanOrEqualTo(likeBtn.snp_left).offset(-5)
|
|
|
+ }
|
|
|
+ likeBtn.snp.remakeConstraints { (make) in
|
|
|
+ make.centerY.equalTo(avatarButton)
|
|
|
+ make.right.equalTo(-13)
|
|
|
+ make.height.equalTo(18)
|
|
|
+ }
|
|
|
+ likeBtn.layoutButton(edgeInsetsStyle: ButtonEdgeInsetsStyle.left, imageTitleSpace: 5)
|
|
|
if PostType(rawValue: communityPostDataModel?.type ?? "video") == .video {
|
|
|
pauseImageView.isHidden = false
|
|
|
}else {
|