UI: fix the layout issue on large font sizes
This commit is contained in:
parent
930e707608
commit
8f90e42ee2
|
|
@ -308,7 +308,7 @@ fun ModelCardContentArchitectureRow(model: ModelInfo) =
|
|||
|
||||
@Composable
|
||||
fun ModelCardContentDatesRow(model: ModelInfo) {
|
||||
val dateFormatter = remember { SimpleDateFormat("MMM d, yyyy", Locale.getDefault()) }
|
||||
val dateFormatter = remember { SimpleDateFormat("MMM d", Locale.getDefault()) }
|
||||
|
||||
Row(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
|
|
|
|||
|
|
@ -537,11 +537,9 @@ fun HuggingFaceModelListItem(
|
|||
modifier = Modifier.fillMaxWidth(),
|
||||
verticalAlignment = Alignment.CenterVertically
|
||||
) {
|
||||
Column(modifier = Modifier.weight(0.9f)) {
|
||||
Row(
|
||||
modifier = Modifier.padding(bottom = 8.dp),
|
||||
verticalAlignment = Alignment.CenterVertically
|
||||
) {
|
||||
Column(modifier = Modifier.fillMaxWidth(0.85f)) {
|
||||
Row(modifier = Modifier.fillMaxWidth().padding(bottom = 8.dp)) {
|
||||
Row(verticalAlignment = Alignment.CenterVertically) {
|
||||
Icon(
|
||||
imageVector = Icons.Default.Attribution,
|
||||
contentDescription = "Author",
|
||||
|
|
@ -557,11 +555,30 @@ fun HuggingFaceModelListItem(
|
|||
)
|
||||
}
|
||||
|
||||
Spacer(modifier = Modifier.weight(1f))
|
||||
|
||||
Row(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
modifier = Modifier.padding(start = 6.dp),
|
||||
verticalAlignment = Alignment.CenterVertically
|
||||
) {
|
||||
Row(modifier = Modifier.weight(5f).padding(end = 8.dp)) {
|
||||
Icon(
|
||||
imageVector = Icons.Default.Favorite,
|
||||
contentDescription = "Favorite count",
|
||||
modifier = Modifier.size(16.dp),
|
||||
tint = MaterialTheme.colorScheme.onSurfaceVariant
|
||||
)
|
||||
|
||||
Text(
|
||||
modifier = Modifier.padding(start = 4.dp),
|
||||
text = formatContextLength(model.likes),
|
||||
style = MaterialTheme.typography.bodyMedium,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Row(modifier = Modifier.fillMaxWidth()) {
|
||||
Row(verticalAlignment = Alignment.CenterVertically) {
|
||||
Icon(
|
||||
imageVector = Icons.Default.Today,
|
||||
contentDescription = "Author",
|
||||
|
|
@ -577,23 +594,12 @@ fun HuggingFaceModelListItem(
|
|||
)
|
||||
}
|
||||
|
||||
Row(modifier = Modifier.weight(3f).padding(end = 8.dp)) {
|
||||
Icon(
|
||||
imageVector = Icons.Default.Favorite,
|
||||
contentDescription = "Favorite count",
|
||||
modifier = Modifier.size(16.dp),
|
||||
tint = MaterialTheme.colorScheme.onSurfaceVariant
|
||||
)
|
||||
Spacer(modifier = Modifier.weight(1f))
|
||||
|
||||
Text(
|
||||
modifier = Modifier.padding(start = 4.dp),
|
||||
text = formatContextLength(model.likes),
|
||||
style = MaterialTheme.typography.bodyMedium,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant
|
||||
)
|
||||
}
|
||||
|
||||
Row(modifier = Modifier.weight(4f).padding(end = 4.dp)) {
|
||||
Row(
|
||||
modifier = Modifier.padding(start = 6.dp),
|
||||
verticalAlignment = Alignment.CenterVertically
|
||||
) {
|
||||
Icon(
|
||||
imageVector = Icons.Default.Download,
|
||||
contentDescription = "Download count",
|
||||
|
|
@ -611,8 +617,10 @@ fun HuggingFaceModelListItem(
|
|||
}
|
||||
}
|
||||
|
||||
Box(modifier = Modifier.fillMaxSize()) {
|
||||
Checkbox(
|
||||
modifier = Modifier.size(32.dp).alpha(if (isSelected) 1f else 0f),
|
||||
modifier = Modifier.align(Alignment.Center).size(32.dp)
|
||||
.alpha(if (isSelected) 1f else 0f),
|
||||
checked = isSelected,
|
||||
onCheckedChange = null, // handled by parent selectable
|
||||
)
|
||||
|
|
@ -620,6 +628,7 @@ fun HuggingFaceModelListItem(
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun DownloadHuggingFaceDispatchedDialog(
|
||||
|
|
|
|||
Loading…
Reference in New Issue