点赞列表显示评论点赞关联的动态
This commit is contained in:
@@ -132,6 +132,8 @@ data class NoticeComment(
|
||||
val replyComment: NoticeComment?,
|
||||
@SerializedName("postId")
|
||||
val postId: Int,
|
||||
@SerializedName("post")
|
||||
val post: NoticePost?,
|
||||
) {
|
||||
fun toNoticeCommentEntity(): NoticeCommentEntity {
|
||||
return NoticeCommentEntity(
|
||||
@@ -139,7 +141,8 @@ data class NoticeComment(
|
||||
content = content,
|
||||
postId = postId,
|
||||
time = ApiClient.dateFromApiString(time),
|
||||
replyComment = replyComment?.toNoticeCommentEntity()
|
||||
replyComment = replyComment?.toNoticeCommentEntity(),
|
||||
post = post?.toNoticePostEntity()
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,6 +88,8 @@ data class NoticeCommentEntity(
|
||||
val replyComment: NoticeCommentEntity?,
|
||||
// 动态
|
||||
val postId: Int,
|
||||
// 动态
|
||||
val post : NoticePostEntity?,
|
||||
)
|
||||
|
||||
/**
|
||||
|
||||
@@ -199,78 +199,100 @@ fun LikeCommentNoticeItem(
|
||||
initImagePagerIndex = 0
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
) {
|
||||
Column(
|
||||
|
||||
) {
|
||||
Row(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
verticalAlignment = Alignment.Top,
|
||||
Row {
|
||||
Column(
|
||||
modifier = Modifier.weight(1f)
|
||||
) {
|
||||
CustomAsyncImage(
|
||||
imageUrl = item.user.avatar,
|
||||
modifier = Modifier
|
||||
.size(48.dp)
|
||||
.clip(CircleShape),
|
||||
contentDescription = stringResource(R.string.like_your_comment)
|
||||
)
|
||||
Spacer(modifier = Modifier.width(12.dp))
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.weight(1f)
|
||||
Row(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
verticalAlignment = Alignment.Top,
|
||||
) {
|
||||
Text(item.user.nickName, fontWeight = FontWeight.Bold, fontSize = 16.sp)
|
||||
Spacer(modifier = Modifier.height(2.dp))
|
||||
Text(stringResource(R.string.like_your_comment))
|
||||
Spacer(modifier = Modifier.height(2.dp))
|
||||
Row {
|
||||
CustomAsyncImage(
|
||||
imageUrl = item.user.avatar,
|
||||
modifier = Modifier
|
||||
.size(48.dp)
|
||||
.clip(CircleShape),
|
||||
contentDescription = stringResource(R.string.like_your_comment)
|
||||
)
|
||||
Spacer(modifier = Modifier.width(12.dp))
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.weight(1f)
|
||||
) {
|
||||
Text(item.user.nickName, fontWeight = FontWeight.Bold, fontSize = 16.sp)
|
||||
Spacer(modifier = Modifier.height(2.dp))
|
||||
Text(stringResource(R.string.like_your_comment))
|
||||
Spacer(modifier = Modifier.height(2.dp))
|
||||
Row {
|
||||
Text(
|
||||
item.likeTime.timeAgo(context),
|
||||
fontSize = 12.sp,
|
||||
color = Color(0x99000000)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
Spacer(modifier = Modifier.height(12.dp))
|
||||
Row(
|
||||
modifier = Modifier.padding(start = 48.dp)
|
||||
) {
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.size(24.dp)
|
||||
.background(Color.Gray.copy(alpha = 0.1f))
|
||||
) {
|
||||
CustomAsyncImage(
|
||||
context = context,
|
||||
imageUrl = MyProfileViewModel.avatar,
|
||||
contentDescription = "Comment Profile Picture",
|
||||
modifier = Modifier.size(24.dp),
|
||||
contentScale = ContentScale.Crop
|
||||
)
|
||||
}
|
||||
Spacer(modifier = Modifier.width(8.dp))
|
||||
Column(
|
||||
modifier = Modifier.weight(1f)
|
||||
) {
|
||||
Text(
|
||||
item.likeTime.timeAgo(context),
|
||||
text = MyProfileViewModel.nickName,
|
||||
fontWeight = FontWeight.W600,
|
||||
fontSize = 14.sp
|
||||
)
|
||||
Text(
|
||||
text = item.comment?.content ?: "",
|
||||
fontSize = 12.sp,
|
||||
color = Color(0x99000000)
|
||||
color = Color(0x99000000),
|
||||
maxLines = 2
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
Spacer(modifier = Modifier.height(12.dp))
|
||||
Row(
|
||||
modifier = Modifier.padding(start = 48.dp)
|
||||
) {
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.size(24.dp)
|
||||
.background(Color.Gray.copy(alpha = 0.1f))
|
||||
) {
|
||||
Spacer(modifier = Modifier.width(16.dp))
|
||||
if (item.comment?.replyComment?.post != null) {
|
||||
item.comment.replyComment.post.let {
|
||||
CustomAsyncImage(
|
||||
context = context,
|
||||
imageUrl = MyProfileViewModel.avatar,
|
||||
contentDescription = "Comment Profile Picture",
|
||||
modifier = Modifier.size(24.dp),
|
||||
imageUrl = it.images[0].thumbnail,
|
||||
contentDescription = "Post Thumbnail",
|
||||
modifier = Modifier.size(48.dp),
|
||||
contentScale = ContentScale.Crop
|
||||
)
|
||||
}
|
||||
Spacer(modifier = Modifier.width(8.dp))
|
||||
Column(
|
||||
modifier = Modifier.weight(1f)
|
||||
) {
|
||||
Text(
|
||||
text = MyProfileViewModel.nickName,
|
||||
fontWeight = FontWeight.W600,
|
||||
fontSize = 14.sp
|
||||
)
|
||||
Text(
|
||||
text = item.comment?.content ?: "",
|
||||
fontSize = 12.sp,
|
||||
color = Color(0x99000000),
|
||||
maxLines = 2
|
||||
} else {
|
||||
item.comment?.post?.let {
|
||||
CustomAsyncImage(
|
||||
context = context,
|
||||
imageUrl = it.images[0].thumbnail,
|
||||
contentDescription = "Post Thumbnail",
|
||||
modifier = Modifier.size(48.dp),
|
||||
contentScale = ContentScale.Crop
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user