fix: keep calendar RSVP buttons on a single line

The Going / Maybe / Can't go buttons in the calendar feed card wrapped
to two lines because the default button content padding (24dp horizontal)
left no room for "Can't go" in an equal-weight third of the row.

Tighten the content padding, shrink the row spacing, and constrain each
label to a single line so the three buttons fit horizontally.
This commit is contained in:
Claude
2026-07-24 04:04:07 +00:00
parent 5800571b77
commit 02c59b332e
@@ -21,6 +21,7 @@
package com.vitorpamplona.amethyst.ui.note.types
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
@@ -34,6 +35,7 @@ import androidx.compose.runtime.getValue
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import com.vitorpamplona.amethyst.commons.resources.Res
@@ -89,7 +91,7 @@ fun CalendarRsvpRow(
Row(
modifier = Modifier.fillMaxWidth().padding(start = 10.dp, end = 10.dp, top = 10.dp, bottom = 12.dp),
horizontalArrangement = Arrangement.spacedBy(8.dp),
horizontalArrangement = Arrangement.spacedBy(6.dp),
) {
RsvpButton(
label = stringResource(Res.string.calendar_rsvp_going),
@@ -128,24 +130,39 @@ private fun RsvpButton(
FilledTonalButton(
onClick = { onClick(status) },
modifier = modifier,
contentPadding = RsvpButtonPadding,
colors =
ButtonDefaults.filledTonalButtonColors(
containerColor = colorFor(status),
contentColor = Color.White,
),
) {
Text(text = label)
RsvpButtonLabel(label)
}
} else {
OutlinedButton(
onClick = { onClick(status) },
modifier = modifier,
contentPadding = RsvpButtonPadding,
) {
Text(text = label)
RsvpButtonLabel(label)
}
}
}
private val RsvpButtonPadding = PaddingValues(horizontal = 8.dp, vertical = 8.dp)
@Composable
private fun RsvpButtonLabel(label: String) {
Text(
text = label,
style = MaterialTheme.typography.labelLarge,
maxLines = 1,
softWrap = false,
overflow = TextOverflow.Ellipsis,
)
}
@Composable
private fun colorFor(status: RSVPStatusTag.STATUS) =
when (status) {