fix(detail): keep the zone card's hierarchy matching the When card
The When card reads date-large, time-small-beneath. The zone card led with the original time at titleMedium and dropped the zone label to bodyMedium, inverting that — which made the foreign time the loudest thing on the screen and pulled attention off the local time the reader actually acts on. Put the label back on top and the original time small beneath it, so both cards read the same way and the original stays available without competing. The label already names the zone, so the range drops its "in New York" tail (and the string with it). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -453,16 +453,20 @@ private fun EventDetailContent(state: EventDetailUiState.Success, modifier: Modi
|
||||
}
|
||||
|
||||
// Time zone — only when the event is timed and pinned to a zone other
|
||||
// than the device's, so cross-zone events read unambiguously. The card
|
||||
// above already answers "when is this for me"; this one answers "when
|
||||
// was it set", which the zone's name alone never did — an 8 AM New York
|
||||
// call showing as 2 PM here should still say 8 AM somewhere.
|
||||
// than the device's, so cross-zone events read unambiguously. It answers
|
||||
// "when was it set", which the zone's name alone never did: an 8 AM New
|
||||
// York call showing as 2 PM here should still say 8 AM somewhere.
|
||||
//
|
||||
// Same hierarchy as the When card above — the label carries the card,
|
||||
// the time sits small beneath it. The local time is the one the reader
|
||||
// acts on, so the original must stay quieter than it, not compete.
|
||||
foreignTimeZoneLabel(detail.eventTimezone, instance.isAllDay, locale)?.let { tzLabel ->
|
||||
Spacer(Modifier.height(gap))
|
||||
DetailCard(
|
||||
icon = Icons.Default.Public,
|
||||
iconContentDescription = stringResource(R.string.event_detail_timezone),
|
||||
) {
|
||||
Text(text = tzLabel, style = MaterialTheme.typography.titleMedium)
|
||||
val originalZone = detail.eventTimezone?.let { tz ->
|
||||
runCatching { TimeZone.of(tz) }.getOrNull()
|
||||
}
|
||||
@@ -473,21 +477,15 @@ private fun EventDetailContent(state: EventDetailUiState.Success, modifier: Modi
|
||||
// the primary instead, so fall back to it rather than
|
||||
// dropping the original time entirely.
|
||||
val (primary, secondary) = formatWhen(instance, originalZone, locale)
|
||||
Text(
|
||||
text = stringResource(
|
||||
R.string.event_detail_timezone_original,
|
||||
secondary ?: primary,
|
||||
originalZone.id.substringAfterLast('/').replace('_', ' '),
|
||||
),
|
||||
style = MaterialTheme.typography.titleMedium,
|
||||
)
|
||||
Spacer(Modifier.height(2.dp))
|
||||
Text(
|
||||
// The label above already names the zone, so the range
|
||||
// needs no "in New York" tail to be unambiguous here.
|
||||
text = secondary ?: primary,
|
||||
style = MaterialTheme.typography.bodyMedium,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
)
|
||||
}
|
||||
Text(
|
||||
text = tzLabel,
|
||||
style = MaterialTheme.typography.bodyMedium,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -111,9 +111,6 @@
|
||||
the same event expressed where the user actually is. %1$s is a time
|
||||
range, e.g. "2:00 PM – 3:00 PM". -->
|
||||
<string name="event_edit_timezone_local_time">%1$s your time</string>
|
||||
<!-- The event's own zone times on the detail screen. %1$s is a time range,
|
||||
%2$s the zone's city, e.g. "8:00 AM – 9:00 AM in New York". -->
|
||||
<string name="event_detail_timezone_original">%1$s in %2$s</string>
|
||||
|
||||
<!-- Event form — per-event color -->
|
||||
<string name="event_edit_color">Color</string>
|
||||
|
||||
Reference in New Issue
Block a user