实现了 Agent 和 Profile 数据类,添加了 AddAgent 界面

This commit is contained in:
weber
2025-07-31 15:22:34 +08:00
parent 6ec732b996
commit 29d2bb753f
28 changed files with 1181 additions and 72 deletions

View File

@@ -395,18 +395,6 @@ fun PostScreen(
viewModel.moment
)
Spacer(modifier = Modifier.height(16.dp))
Box(
modifier = Modifier
.fillMaxWidth()
.padding(horizontal = 16.dp)
.height(1.dp)
.background(
AppColors.divider
)
) {
}
Spacer(modifier = Modifier.height(24.dp))
Row(
modifier = Modifier
.fillMaxWidth()
@@ -419,7 +407,8 @@ fun PostScreen(
R.string.comment_count,
(viewModel.moment?.commentCount ?: 0)
), fontSize = 14.sp,
color = AppColors.text
fontWeight = FontWeight.Bold,
color = AppColors.nonActiveText
)
Spacer(modifier = Modifier.weight(1f))
OrderSelectionComponent() {
@@ -724,13 +713,13 @@ fun Header(
.noRippleClickable {
navController.navigateUp()
}
.size(32.dp),
.size(24.dp),
colorFilter = ColorFilter.tint(AppColors.text)
)
Spacer(modifier = Modifier.width(8.dp))
Box(
modifier = Modifier
.size(40.dp)
.size(32.dp)
.clip(CircleShape)
.background(AppColors.secondaryText.copy(alpha = 0.1f))
) {
@@ -739,7 +728,7 @@ fun Header(
avatar,
contentDescription = "Profile Picture",
modifier = Modifier
.size(40.dp)
.size(32.dp)
.clip(CircleShape)
.noRippleClickable {
userId?.let {
@@ -761,6 +750,7 @@ fun Header(
fontWeight = FontWeight.Bold,
modifier = Modifier.weight(1f),
color = AppColors.text,
fontSize = 17.sp
)
if (AppState.UserId != userId && !isFollowing) {
FollowButton(
@@ -774,7 +764,7 @@ fun Header(
Box {
Image(
modifier = Modifier
.height(20.dp)
.height(24.dp)
.padding(end = 8.dp)
.noRippleClickable {
expanded = true
@@ -1049,12 +1039,15 @@ fun PostDetails(
if (!momentEntity?.momentTextContent.isNullOrEmpty()) {
Text(
text = momentEntity?.momentTextContent ?: "",
fontSize = 16.sp,
fontWeight = FontWeight.Bold,
fontSize = 14.sp,
color = AppColors.text,
)
}
Text(text = "${momentEntity?.time?.formatPostTime()}", color = AppColors.text)
Text(
modifier = Modifier.padding(top = 16.dp),
text = "${momentEntity?.time?.formatPostTime()}",
color = AppColors.nonActiveText,
fontSize = 12.sp)
}
}
@@ -1084,7 +1077,8 @@ fun CommentItem(
Row(modifier = Modifier.padding(vertical = 8.dp)) {
Box(
modifier = Modifier
.size(if (isChild) 24.dp else 40.dp)
.size(if (isChild) 24.dp else 32.dp)
.clip(CircleShape)
.background(Color.Gray.copy(alpha = 0.1f))
.noRippleClickable {
navController.navigate(
@@ -1099,7 +1093,8 @@ fun CommentItem(
context = context,
imageUrl = commentEntity.avatar,
contentDescription = "Comment Profile Picture",
modifier = Modifier.size(if (isChild) 24.dp else 40.dp),
modifier = Modifier.size(if (isChild) 24.dp else 32.dp)
.clip(CircleShape),
contentScale = ContentScale.Crop
)
}
@@ -1115,13 +1110,21 @@ fun CommentItem(
}
) {}
) {
Text(
text = commentEntity.name,
fontWeight = FontWeight.W600,
fontSize = 14.sp,
color = AppColors.text
)
Row {
Text(
text = commentEntity.name,
fontWeight = FontWeight.Bold,
fontSize = 11.sp,
color = AppColors.text
)
Spacer(modifier = Modifier.width(8.dp))
Text(
text = commentEntity.date.timeAgo(context),
fontSize = 11.sp,
color = Color.Gray
)
}
Row (modifier = Modifier.padding(top = 4.dp)){
if (isChild) {
val annotatedText = buildAnnotatedString {
if (commentEntity.replyUserId != null) {
@@ -1169,9 +1172,10 @@ fun CommentItem(
} else {
Text(
text = commentEntity.comment,
fontSize = 14.sp,
fontSize = 13.sp,
maxLines = Int.MAX_VALUE,
softWrap = true,
lineHeight = 20.sp,
color = AppColors.text,
modifier = Modifier.combinedClickable(
interactionSource = remember { MutableInteractionSource() },
@@ -1187,18 +1191,42 @@ fun CommentItem(
)
}
}
Row {
Text(
text = commentEntity.date.timeAgo(context),
fontSize = 12.sp,
color = Color.Gray
Row (modifier = Modifier.padding(top = 12.dp),
verticalAlignment = Alignment.CenterVertically,){
AnimatedLikeIcon(
liked = commentEntity.liked,
onClick = {
onLike(commentEntity)
},
modifier = Modifier.size(16.dp)
)
Spacer(modifier = Modifier.width(8.dp))
Spacer(modifier = Modifier.width(4.dp))
Text(
text = commentEntity.likes.toString(),
fontSize = 12.sp,
fontWeight = FontWeight.Bold,
color = AppColors.text
)
Text(
text = stringResource(R.string.like),
fontSize = 12.sp,
fontWeight = FontWeight.Bold,
color = AppColors.nonActiveText,
)
Spacer(modifier = Modifier.width(27.dp))
if (AppState.UserId?.toLong() != commentEntity.author) {
Icon(
painter = painterResource(id = R.drawable.rider_pro_comment),
contentDescription = "",
modifier = Modifier.size(16.dp),
tint = AppColors.nonActiveText
)
Spacer(modifier = Modifier.width(4.dp))
Text(
text = stringResource(R.string.reply),
fontSize = 12.sp,
color = AppColors.secondaryText,
fontWeight = FontWeight.Bold,
color = AppColors.nonActiveText,
modifier = Modifier.noRippleClickable {
onReply(
commentEntity,
@@ -1213,23 +1241,6 @@ fun CommentItem(
}
}
Spacer(modifier = Modifier.width(16.dp))
Column(
horizontalAlignment = Alignment.CenterHorizontally
) {
AnimatedLikeIcon(
liked = commentEntity.liked,
onClick = {
onLike(commentEntity)
},
modifier = Modifier.size(20.dp)
)
Text(
text = commentEntity.likes.toString(),
fontSize = 12.sp,
color = AppColors.text
)
}
}
Spacer(modifier = Modifier.height(8.dp))
Column(
@@ -1267,8 +1278,8 @@ fun CommentItem(
val remaining = commentEntity.replyCount - commentEntity.reply.size
Text(
text = stringResource(R.string.view_more_reply, remaining),
fontSize = 12.sp,
color = Color(0xFF6F94AE),
fontSize = 14.sp,
color = AppColors.nonActiveText,
modifier = Modifier.noRippleClickable {
onLoadMoreSubComments?.invoke(commentEntity)
}