fix: 临近任务卡片显示过长分类时出错
This commit is contained in:
parent
d082bf918e
commit
5789fae320
1 changed files with 9 additions and 3 deletions
|
|
@ -3,9 +3,11 @@ package cn.super12138.todo.ui.pages.overview.components
|
||||||
import androidx.compose.foundation.layout.Arrangement
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
import androidx.compose.foundation.layout.Row
|
import androidx.compose.foundation.layout.Row
|
||||||
|
import androidx.compose.foundation.layout.Spacer
|
||||||
import androidx.compose.foundation.layout.fillMaxWidth
|
import androidx.compose.foundation.layout.fillMaxWidth
|
||||||
import androidx.compose.foundation.layout.height
|
import androidx.compose.foundation.layout.height
|
||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
|
import androidx.compose.foundation.layout.size
|
||||||
import androidx.compose.foundation.layout.wrapContentHeight
|
import androidx.compose.foundation.layout.wrapContentHeight
|
||||||
import androidx.compose.foundation.lazy.LazyColumn
|
import androidx.compose.foundation.lazy.LazyColumn
|
||||||
import androidx.compose.foundation.lazy.items
|
import androidx.compose.foundation.lazy.items
|
||||||
|
|
@ -112,17 +114,21 @@ fun UpcomingTaskItem(
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
Row(verticalAlignment = Alignment.CenterVertically) {
|
Row(
|
||||||
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
|
modifier = Modifier.fillMaxWidth()
|
||||||
|
) {
|
||||||
Badge(containerColor = MaterialTheme.colorScheme.primary) {
|
Badge(containerColor = MaterialTheme.colorScheme.primary) {
|
||||||
Text(
|
Text(
|
||||||
text = category.ifEmpty { stringResource(R.string.tip_default_category) },
|
text = category.ifEmpty { stringResource(R.string.tip_default_category) },
|
||||||
style = MaterialTheme.typography.labelMedium,
|
style = MaterialTheme.typography.labelMedium,
|
||||||
maxLines = 1,
|
maxLines = 1,
|
||||||
overflow = TextOverflow.Ellipsis,
|
overflow = TextOverflow.Ellipsis
|
||||||
modifier = Modifier.weight(1f)
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Spacer(modifier = Modifier.weight(1f))
|
||||||
|
|
||||||
Text(
|
Text(
|
||||||
text = stringResource(priority.nameRes),
|
text = stringResource(priority.nameRes),
|
||||||
style = MaterialTheme.typography.labelMedium.copy(priority.containerColor()),
|
style = MaterialTheme.typography.labelMedium.copy(priority.containerColor()),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue