feat: refactor RequestsSection header layout and reposition badge display
This commit is contained in:
@@ -3190,44 +3190,15 @@ fun RequestsSection(
|
|||||||
Spacer(modifier = Modifier.width(12.dp))
|
Spacer(modifier = Modifier.width(12.dp))
|
||||||
|
|
||||||
Column(modifier = Modifier.weight(1f)) {
|
Column(modifier = Modifier.weight(1f)) {
|
||||||
// Верхняя строка: название + badge
|
// Заголовок
|
||||||
Row(
|
Text(
|
||||||
modifier = Modifier.fillMaxWidth(),
|
text = "Requests",
|
||||||
horizontalArrangement = Arrangement.SpaceBetween,
|
fontWeight = FontWeight.SemiBold,
|
||||||
verticalAlignment = Alignment.CenterVertically
|
fontSize = 16.sp,
|
||||||
) {
|
color = titleColor,
|
||||||
Text(
|
maxLines = 1,
|
||||||
text = "Requests",
|
overflow = TextOverflow.Ellipsis
|
||||||
fontWeight = FontWeight.SemiBold,
|
)
|
||||||
fontSize = 16.sp,
|
|
||||||
color = titleColor,
|
|
||||||
maxLines = 1,
|
|
||||||
overflow = TextOverflow.Ellipsis,
|
|
||||||
modifier = Modifier.weight(1f)
|
|
||||||
)
|
|
||||||
|
|
||||||
// Badge справа на уровне заголовка
|
|
||||||
if (count > 0) {
|
|
||||||
Spacer(modifier = Modifier.width(8.dp))
|
|
||||||
Box(
|
|
||||||
modifier =
|
|
||||||
Modifier
|
|
||||||
.defaultMinSize(minWidth = 22.dp, minHeight = 22.dp)
|
|
||||||
.clip(CircleShape)
|
|
||||||
.background(badgeColor),
|
|
||||||
contentAlignment = Alignment.Center
|
|
||||||
) {
|
|
||||||
Text(
|
|
||||||
text = if (count > 99) "99+" else count.toString(),
|
|
||||||
fontSize = 12.sp,
|
|
||||||
fontWeight = FontWeight.Bold,
|
|
||||||
color = Color.White,
|
|
||||||
lineHeight = 12.sp,
|
|
||||||
modifier = Modifier.padding(horizontal = 5.dp, vertical = 3.dp)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Нижняя строка: subtitle (последний запрос)
|
// Нижняя строка: subtitle (последний запрос)
|
||||||
if (subtitle.isNotEmpty()) {
|
if (subtitle.isNotEmpty()) {
|
||||||
@@ -3241,6 +3212,28 @@ fun RequestsSection(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Badge — вертикально отцентрирован в строке
|
||||||
|
if (count > 0) {
|
||||||
|
Spacer(modifier = Modifier.width(8.dp))
|
||||||
|
Box(
|
||||||
|
modifier =
|
||||||
|
Modifier
|
||||||
|
.defaultMinSize(minWidth = 22.dp, minHeight = 22.dp)
|
||||||
|
.clip(CircleShape)
|
||||||
|
.background(badgeColor),
|
||||||
|
contentAlignment = Alignment.Center
|
||||||
|
) {
|
||||||
|
Text(
|
||||||
|
text = if (count > 99) "99+" else count.toString(),
|
||||||
|
fontSize = 12.sp,
|
||||||
|
fontWeight = FontWeight.Bold,
|
||||||
|
color = Color.White,
|
||||||
|
lineHeight = 12.sp,
|
||||||
|
modifier = Modifier.padding(horizontal = 5.dp, vertical = 3.dp)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user