Agent卡片组件UI;Agent聊天界面输入框显示问题

This commit is contained in:
2025-09-15 11:27:01 +08:00
parent 349d39daf2
commit e74e8615a5
2 changed files with 18 additions and 13 deletions

View File

@@ -283,7 +283,7 @@ fun ChatAiScreen(userId: String) {
Box( Box(
modifier = Modifier modifier = Modifier
.fillMaxSize() .fillMaxSize()
.background(AppColors.decentBackground) .background(Color.White)
.padding(paddingValues) .padding(paddingValues)
) { ) {
LazyColumn( LazyColumn(

View File

@@ -369,7 +369,7 @@ fun Agent() {
.fillMaxWidth() .fillMaxWidth()
.weight(1f) .weight(1f)
) { ) {
val agentItems = viewModel.agentItems.take(15) val agentItems = viewModel.agentItems
LazyVerticalGrid( LazyVerticalGrid(
columns = GridCells.Fixed(2), columns = GridCells.Fixed(2),
modifier = Modifier.fillMaxWidth(), modifier = Modifier.fillMaxWidth(),
@@ -391,7 +391,7 @@ fun Agent() {
@Composable @Composable
fun AgentCardSquare(agentItem: AgentItem, viewModel: AgentViewModel, navController: NavHostController) { fun AgentCardSquare(agentItem: AgentItem, viewModel: AgentViewModel, navController: NavHostController) {
val AppColors = LocalAppTheme.current val AppColors = LocalAppTheme.current
val cardHeight = 180.dp val cardHeight = 200.dp
val avatarSize = cardHeight / 3 // 头像大小为方块高度的三分之一 val avatarSize = cardHeight / 3 // 头像大小为方块高度的三分之一
// 防抖状态 // 防抖状态
@@ -449,7 +449,7 @@ fun AgentCardSquare(agentItem: AgentItem, viewModel: AgentViewModel, navControll
) { ) {
androidx.compose.material3.Text( androidx.compose.material3.Text(
text = agentItem.title, text = agentItem.title,
fontSize = 16.sp, fontSize = 14.sp,
fontWeight = androidx.compose.ui.text.font.FontWeight.W600, fontWeight = androidx.compose.ui.text.font.FontWeight.W600,
color = AppColors.text, color = AppColors.text,
maxLines = 1, maxLines = 1,
@@ -458,21 +458,26 @@ fun AgentCardSquare(agentItem: AgentItem, viewModel: AgentViewModel, navControll
Spacer(modifier = Modifier.height(8.dp)) Spacer(modifier = Modifier.height(8.dp))
androidx.compose.material3.Text( Box(
text = agentItem.desc, modifier = Modifier
fontSize = 14.sp, .height(85.dp)
color = AppColors.secondaryText, .fillMaxWidth()
maxLines = 2, ) {
overflow = androidx.compose.ui.text.style.TextOverflow.Ellipsis, androidx.compose.material3.Text(
modifier = Modifier.weight(1f, fill = false) text = agentItem.desc,
) fontSize = 12.sp,
color = AppColors.secondaryText,
maxLines = 5,
overflow = androidx.compose.ui.text.style.TextOverflow.Ellipsis,
)
}
Spacer(modifier = Modifier.height(8.dp)) Spacer(modifier = Modifier.height(8.dp))
// 聊天按钮,位于底部居中 // 聊天按钮,位于底部居中
Box( Box(
modifier = Modifier modifier = Modifier
.width(80.dp) .width(60.dp)
.height(32.dp) .height(32.dp)
.background( .background(
color = Color(0X147c7480), color = Color(0X147c7480),