fix: исправлен layout отображения доходов на экране статистики
- EarningsCard: добавлен Spacer между описанием и суммой, ограничение описания до 2 строк с Ellipsis, выравнивание суммы по правому краю - BreakdownRow: padding vertical 2→4dp, label получает weight(1f), сумма выровнена по правому краю через TextAlign.End - SummaryRow: те же правки — padding 2→4dp, weight(1f) для label, TextAlign.End для значения - EarningsBarChart: добавлен TextOverflow.Clip для меток оси X
This commit is contained in:
@@ -85,6 +85,7 @@ fun EarningsBarChart(
|
|||||||
color = labelColor,
|
color = labelColor,
|
||||||
textAlign = TextAlign.Center,
|
textAlign = TextAlign.Center,
|
||||||
maxLines = 1,
|
maxLines = 1,
|
||||||
|
overflow = androidx.compose.ui.text.style.TextOverflow.Clip,
|
||||||
modifier = Modifier.weight(1f)
|
modifier = Modifier.weight(1f)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -237,14 +237,19 @@ private fun EarningsCard(
|
|||||||
Text(
|
Text(
|
||||||
text = description,
|
text = description,
|
||||||
style = MaterialTheme.typography.bodySmall,
|
style = MaterialTheme.typography.bodySmall,
|
||||||
color = MaterialTheme.colorScheme.onSurfaceVariant
|
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||||
|
maxLines = 2,
|
||||||
|
overflow = androidx.compose.ui.text.style.TextOverflow.Ellipsis
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
Spacer(Modifier.width(8.dp))
|
||||||
Text(
|
Text(
|
||||||
text = "${currencySymbol}${String.format(Locale.getDefault(), "%.2f", amount)}",
|
text = "${currencySymbol}${String.format(Locale.getDefault(), "%.2f", amount)}",
|
||||||
style = MaterialTheme.typography.titleLarge,
|
style = MaterialTheme.typography.titleLarge,
|
||||||
fontWeight = FontWeight.Bold,
|
fontWeight = FontWeight.Bold,
|
||||||
color = color
|
color = color,
|
||||||
|
maxLines = 1,
|
||||||
|
textAlign = androidx.compose.ui.text.style.TextAlign.End
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -295,13 +300,19 @@ private fun BreakdownRow(
|
|||||||
style: androidx.compose.ui.text.TextStyle
|
style: androidx.compose.ui.text.TextStyle
|
||||||
) {
|
) {
|
||||||
Row(
|
Row(
|
||||||
modifier = Modifier.fillMaxWidth().padding(vertical = 2.dp),
|
modifier = Modifier.fillMaxWidth().padding(vertical = 4.dp),
|
||||||
horizontalArrangement = Arrangement.SpaceBetween
|
horizontalArrangement = Arrangement.SpaceBetween,
|
||||||
|
verticalAlignment = Alignment.CenterVertically
|
||||||
) {
|
) {
|
||||||
Text(label, style = style)
|
Text(
|
||||||
|
label,
|
||||||
|
style = style,
|
||||||
|
modifier = Modifier.weight(1f)
|
||||||
|
)
|
||||||
Text(
|
Text(
|
||||||
"${currencySymbol}${String.format(Locale.getDefault(), "%.2f", amount)}",
|
"${currencySymbol}${String.format(Locale.getDefault(), "%.2f", amount)}",
|
||||||
style = style
|
style = style,
|
||||||
|
textAlign = androidx.compose.ui.text.style.TextAlign.End
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -384,11 +395,21 @@ private fun ShiftsSummary(shifts: List<Shift>, currencySymbol: String, templates
|
|||||||
@Composable
|
@Composable
|
||||||
private fun SummaryRow(label: String, value: String) {
|
private fun SummaryRow(label: String, value: String) {
|
||||||
Row(
|
Row(
|
||||||
modifier = Modifier.fillMaxWidth().padding(vertical = 2.dp),
|
modifier = Modifier.fillMaxWidth().padding(vertical = 4.dp),
|
||||||
horizontalArrangement = Arrangement.SpaceBetween
|
horizontalArrangement = Arrangement.SpaceBetween,
|
||||||
|
verticalAlignment = Alignment.CenterVertically
|
||||||
) {
|
) {
|
||||||
Text(label, style = MaterialTheme.typography.bodyMedium)
|
Text(
|
||||||
Text(value, style = MaterialTheme.typography.bodyMedium, fontWeight = FontWeight.Medium)
|
label,
|
||||||
|
style = MaterialTheme.typography.bodyMedium,
|
||||||
|
modifier = Modifier.weight(1f)
|
||||||
|
)
|
||||||
|
Text(
|
||||||
|
value,
|
||||||
|
style = MaterialTheme.typography.bodyMedium,
|
||||||
|
fontWeight = FontWeight.Medium,
|
||||||
|
textAlign = androidx.compose.ui.text.style.TextAlign.End
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user