fix(stats): fix incorrect corner radius in 1D heatmap

This commit is contained in:
Nishant Mishra
2025-12-12 19:19:16 +05:30
parent c39089de21
commit d5e3890e4e
3 changed files with 21 additions and 15 deletions

View File

@@ -72,19 +72,21 @@ fun VariableWidth1DHeatmap(
) {
values.fastForEachIndexed { index, item ->
if (item > 0L) {
val shape = when (index) {
firstNonZeroIndex -> shapes.large.copy(
topEnd = shapes.extraSmall.topEnd,
bottomEnd = shapes.extraSmall.bottomEnd
)
val shape =
if (firstNonZeroIndex == lastNonZeroIndex) shapes.large
else when (index) {
firstNonZeroIndex -> shapes.large.copy(
topEnd = shapes.extraSmall.topEnd,
bottomEnd = shapes.extraSmall.bottomEnd
)
lastNonZeroIndex -> shapes.large.copy(
topStart = shapes.extraSmall.topStart,
bottomStart = shapes.extraSmall.bottomStart
)
lastNonZeroIndex -> shapes.large.copy(
topStart = shapes.extraSmall.topStart,
bottomStart = shapes.extraSmall.bottomStart
)
else -> shapes.extraSmall
}
else -> shapes.extraSmall
}
Spacer(
Modifier
.weight(item.toFloat())

View File

@@ -204,11 +204,11 @@ fun SharedTransitionScope.LastWeekScreen(
item {
Text(
"Focus overview",
stringResource(R.string.focus_overview),
style = typography.headlineSmall
)
Text(
"Average focus durations at different times of the day",
stringResource(R.string.focus_overview_desc),
style = typography.bodySmall,
color = colorScheme.onSurfaceVariant
)
@@ -249,11 +249,11 @@ fun SharedTransitionScope.LastWeekScreen(
item {
Text(
"Focus insights",
stringResource(R.string.focus_insights),
style = typography.headlineSmall
)
Text(
"Focus overview of each day of the past week",
stringResource(R.string.focus_insights_desc),
style = typography.bodySmall,
color = colorScheme.onSurfaceVariant
)

View File

@@ -114,4 +114,8 @@
<string name="timer_reset_message">Timer reset</string>
<string name="undo">Undo</string>
<string name="focus_break_ratio">Focus-break ratio</string>
<string name="focus_overview">Focus overview</string>
<string name="focus_overview_desc">Average focus durations at different times of the day</string>
<string name="focus_insights">Focus insights</string>
<string name="focus_insights_desc">Focus overview of each day of the past week (click on each cell for more info)</string>
</resources>