Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion app/src/main/assets/i18n/pt-BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -991,6 +991,7 @@
"Lets the coach read your data. Detect sets this for you; turn it off if your server rejects tools (vLLM needs --enable-auto-tool-choice).": "Permite que o coach leia seus dados. Detectar define isso para você; desative se o seu servidor rejeitar ferramentas (o vLLM precisa de --enable-auto-tool-choice).",
"Library": "Biblioteca",
"License": "Licença",
"Life stage": "Fase da vida",
"Light": "Leve",
"Limited": "Limitado",
"Limited HR data available for today.": "Poucos dados de FC disponíveis para hoje.",
Expand Down Expand Up @@ -1567,7 +1568,7 @@
"Score {0} out of 100": "Pontuação {0} de 100",
"Scores are PulseLoop estimates from ring data compared with the user's own baseline, not medical measurements.": "As pontuações são estimativas do PulseLoop a partir dos dados do anel comparados com a linha de base do próprio usuário, não medidas médicas.",
"Screens in bed": "Telas na cama",
"Screens that have moved to it so far: Today, Vitals, Sleep, Activity, Nutrition, My Health, Readiness, Symptom Radar, Settings.": "Telas que já usam o novo visual: Hoje, Vitais, Sono, Atividade, Nutrição, Minha saúde, Prontidão, Radar de sintomas, Configurações.",
"Screens that have moved to it so far: Today, Vitals, Sleep, Activity, Nutrition, My Health, Readiness, Symptom Radar, Settings and its screens.": "Telas que já usam o novo visual: Hoje, Vitais, Sono, Atividade, Nutrição, Minha saúde, Prontidão, Radar de sintomas, Configurações e suas telas.",
"Searching…": "Procurando…",
"See Raw Packets above.": "Veja Pacotes brutos acima.",
"See Ring Events above.": "Veja Eventos do anel acima.",
Expand Down
36 changes: 36 additions & 0 deletions app/src/main/java/com/pulseloop/ui/calm/CalmTheme.kt
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,39 @@ fun CalmTypography(enabled: Boolean = true, content: @androidx.compose.runtime.C
androidx.compose.material3.ProvideTextStyle(androidx.compose.material3.LocalTextStyle.current.inter(), content)
}
}

/**
* [CalmTypography] plus the new look's neutrals in Material's colour roles, for a screen whose
* content reads `MaterialTheme` rather than naming colours (the Settings sub-screens: switches,
* text fields, `onSurfaceVariant` captions, dialogs). Brand and status roles (primary, error) are
* left as they are. Input outlines use [CalmColors.textMuted], since the hairline [CalmColors.border]
* is too faint for a control's boundary (3:1).
*/
@androidx.compose.runtime.Composable
fun CalmMaterial(enabled: Boolean = true, content: @androidx.compose.runtime.Composable () -> Unit) {
if (!enabled) { content(); return }
val c = androidx.compose.material3.MaterialTheme.colorScheme
val scheme = c.copy(
background = CalmColors.page,
onBackground = CalmColors.text,
surface = CalmColors.card,
onSurface = CalmColors.text,
surfaceVariant = CalmColors.card,
onSurfaceVariant = CalmColors.textSecondary,
surfaceContainerLowest = CalmColors.page,
surfaceContainerLow = CalmColors.card,
surfaceContainer = CalmColors.card,
surfaceContainerHigh = CalmColors.cardRaised,
surfaceContainerHighest = CalmColors.cardRaised,
outline = CalmColors.textMuted,
outlineVariant = CalmColors.border,
// Tonal buttons: the app's scheme never set these, so Material's default lavender showed.
secondaryContainer = CalmColors.cardRaised,
onSecondaryContainer = CalmColors.text,
)
androidx.compose.material3.MaterialTheme(
colorScheme = scheme,
shapes = androidx.compose.material3.MaterialTheme.shapes,
typography = androidx.compose.material3.MaterialTheme.typography,
) { CalmTypography(content = content) }
}
24 changes: 24 additions & 0 deletions app/src/main/java/com/pulseloop/ui/calm/Look.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import com.pulseloop.ui.theme.PulseColors
import com.pulseloop.ui.theme.PulseType
import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.font.FontWeight

/**
* The surface and text roles of whichever look is on, for pieces shared by converted and
Expand All @@ -25,6 +28,27 @@ object Look {
val textSecondary: Color get() = if (calm) CalmColors.textSecondary else PulseColors.textSecondary
val textMuted: Color get() = if (calm) CalmColors.textMuted else PulseColors.textMuted
val radius: Dp get() = if (calm) CalmShape.radius else 8.dp

/** A card's or a row's title (PulseType.title / CalmType.title). */
val titleStyle: TextStyle get() = if (calm) CalmType.title else PulseType.title
/** Running text (PulseType.body / CalmType.bodySmall, both 14sp). */
val bodyStyle: TextStyle get() = if (calm) CalmType.bodySmall else PulseType.body
/** Small text: an address, a caption (12sp in both). */
val labelStyle: TextStyle get() = if (calm) CalmType.label.copy(fontWeight = FontWeight.Normal) else PulseType.label
}

/**
* The name over a group of controls. The old look's tracked capitals (PulseType.eyebrow); in the
* new look sentence case at 14sp, since a caps kicker over content is what the craft floor bans.
* Pass the text in sentence case: the old look upper-cases it.
*/
@androidx.compose.runtime.Composable
fun LookLabel(text: String, modifier: Modifier = Modifier) {
if (Look.calm) {
androidx.compose.material3.Text(text, style = CalmType.bodySmall.copy(fontWeight = FontWeight.SemiBold), color = Look.textSecondary, modifier = modifier)
} else {
androidx.compose.material3.Text(text.uppercase(), style = PulseType.eyebrow, color = PulseColors.textSecondary, modifier = modifier)
}
}

/**
Expand Down
11 changes: 3 additions & 8 deletions app/src/main/java/com/pulseloop/ui/components/AppChrome.kt
Original file line number Diff line number Diff line change
Expand Up @@ -241,14 +241,9 @@ fun greetingForHour(): String = when (Calendar.getInstance().get(Calendar.HOUR_O
@Composable
fun SectionHeaderCaps(title: String, modifier: Modifier = Modifier, action: (@Composable () -> Unit)? = null) {
Row(modifier = modifier.fillMaxWidth(), verticalAlignment = Alignment.CenterVertically) {
Text(
title.uppercase(),
// The one eyebrow style (12sp, 1sp tracking), not a hand-rolled 14sp variant.
style = PulseType.eyebrow,
color = PulseColors.textSecondary,
// Takes the free width (instead of a Spacer) so a long title wraps beside the action.
modifier = Modifier.weight(1f),
)
// Takes the free width (instead of a Spacer) so a long title wraps beside the action. The
// new look writes it in sentence case (LookLabel): no caps kicker over content.
com.pulseloop.ui.calm.LookLabel(title, modifier = Modifier.weight(1f))
action?.invoke()
}
}
Expand Down
16 changes: 14 additions & 2 deletions app/src/main/java/com/pulseloop/ui/components/PulseSegmented.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.text.style.TextOverflow
import com.pulseloop.ui.theme.PulseColors
import com.pulseloop.ui.theme.PulseType
import com.pulseloop.ui.calm.CalmColors
import com.pulseloop.ui.calm.CalmType
import com.pulseloop.ui.calm.Look

/**
* The one segmented control (Sleep's Day/Week/Month/Year, a vital's Today/Week/Month): Material's
Expand All @@ -31,7 +34,16 @@ fun <T> PulseSegmented(
onClick = { onSelect(key) },
shape = SegmentedButtonDefaults.itemShape(index, options.size),
icon = {},
colors = SegmentedButtonDefaults.colors(
// The new look marks the choice with a raised surface and full-strength text rather
// than a mint fill: mint is for what to tap, and every segment is tappable.
colors = if (Look.calm) SegmentedButtonDefaults.colors(
activeContainerColor = CalmColors.cardRaised,
activeContentColor = CalmColors.text,
activeBorderColor = CalmColors.textMuted,
inactiveContainerColor = CalmColors.card,
inactiveContentColor = CalmColors.textSecondary,
inactiveBorderColor = CalmColors.textMuted,
) else SegmentedButtonDefaults.colors(
activeContainerColor = PulseColors.accentSoft,
activeContentColor = PulseColors.textPrimary,
activeBorderColor = PulseColors.accent,
Expand All @@ -40,7 +52,7 @@ fun <T> PulseSegmented(
inactiveBorderColor = PulseColors.borderStrong,
),
) {
Text(label, style = PulseType.label, maxLines = 1, overflow = TextOverflow.Ellipsis)
Text(label, style = if (Look.calm) CalmType.bodySmall else PulseType.label, maxLines = 1, overflow = TextOverflow.Ellipsis)
}
}
}
Expand Down
Loading
Loading