From 4bfa2c49709a2bf01bd0241bfc5d57e23726268d Mon Sep 17 00:00:00 2001 From: Super12138 <70494801+Super12138@users.noreply.github.com> Date: Sat, 11 Jan 2025 22:25:40 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=BE=85=E5=8A=9E=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E8=BF=87=E9=95=BF=E7=9A=84=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E9=94=99=E8=AF=AF=EF=BC=88=E6=B7=BB=E5=8A=A0=E8=B7=91=E9=A9=AC?= =?UTF-8?q?=E7=81=AF=E6=95=88=E6=9E=9C=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../todo/ui/pages/main/components/TodoCard.kt | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/app/src/main/kotlin/cn/super12138/todo/ui/pages/main/components/TodoCard.kt b/app/src/main/kotlin/cn/super12138/todo/ui/pages/main/components/TodoCard.kt index ca98cd3..8f4220b 100644 --- a/app/src/main/kotlin/cn/super12138/todo/ui/pages/main/components/TodoCard.kt +++ b/app/src/main/kotlin/cn/super12138/todo/ui/pages/main/components/TodoCard.kt @@ -1,5 +1,6 @@ package cn.super12138.todo.ui.pages.main.components +import androidx.compose.foundation.basicMarquee import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row @@ -17,6 +18,7 @@ import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier +import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.unit.dp @Composable @@ -37,7 +39,7 @@ fun TodoCard( verticalAlignment = Alignment.CenterVertically, modifier = Modifier .fillMaxSize() - .padding(start = 15.dp, end = 15.dp) + .padding(horizontal = 15.dp) ) { Column( verticalArrangement = Arrangement.Center, @@ -47,11 +49,15 @@ fun TodoCard( ) { Text( text = content, - style = MaterialTheme.typography.titleLarge + style = MaterialTheme.typography.titleLarge, + maxLines = 1, + overflow = TextOverflow.Ellipsis, + modifier = Modifier.basicMarquee() // TODO: 后续评估性能影响 ) Text( text = subject, - style = MaterialTheme.typography.labelMedium + style = MaterialTheme.typography.labelMedium, + maxLines = 1 ) } @@ -59,7 +65,7 @@ fun TodoCard( Icon( imageVector = Icons.Outlined.Check, tint = MaterialTheme.colorScheme.primary, - contentDescription = "" + contentDescription = "" // TODO: 无障碍适配 ) }