Rename rate labels, style them like other amount fields

"1 BTC to USD" -> "BTC to USD", "1 <currency> to Sats" -> "<currency>
to Sats" (the "1 " was redundant with the field itself now carrying
the label).

Compose: the BTC-to-currency rate and currency-to-sats value are now
OutlinedTextFields (read-only, matching the enabled/disabled styling
of the Currencies section's fields) instead of plain Text, with the
label folded into the field itself rather than a separate heading.
The manual-source rate field's label changes from generic "Rate" to
the same "BTC to <currency>".

iOS/macOS: dropped the Section's "1 BTC to <currency>" header;
the label now sits directly on the rate row (label left, value
right), matching the existing Sats/BTC/currency field rows and the
already-matching "<currency> to Sats" row below it.

rate_label is now unused and removed.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FXcrACM5sok3M1KQJ8kByy
This commit is contained in:
2026-09-10 10:14:05 +03:00
co-authored by Claude Sonnet 5
parent 947f8bf81a
commit 161c219d60
3 changed files with 29 additions and 35 deletions
@@ -5,7 +5,6 @@ import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.WindowInsetsSides
import androidx.compose.foundation.layout.fillMaxSize
@@ -168,11 +167,6 @@ fun PriceScreen(
)
}
Text(
text = stringResource(MR.strings.btc_to_currency, state.defaultCurrencyCode),
style = MaterialTheme.typography.bodyMedium,
)
Row(
modifier = Modifier.fillMaxWidth(),
horizontalArrangement = Arrangement.spacedBy(8.dp),
@@ -182,7 +176,7 @@ fun PriceScreen(
OutlinedTextField(
value = state.manualRateInput,
onValueChange = viewModel::onManualRateChanged,
label = { Text(stringResource(MR.strings.rate_label)) },
label = { Text(stringResource(MR.strings.btc_to_currency, state.defaultCurrencyCode)) },
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Decimal),
singleLine = true,
visualTransformation = DigitGroupingTransformation,
@@ -190,15 +184,16 @@ fun PriceScreen(
)
} else {
val rate = state.defaultCurrencyRate()
if (rate.isNotEmpty()) {
Text(
text = groupDigits(rate),
style = MaterialTheme.typography.headlineSmall,
modifier = Modifier.weight(1f),
)
} else {
Spacer(modifier = Modifier.weight(1f))
}
OutlinedTextField(
value = rate,
onValueChange = {},
readOnly = true,
enabled = rate.isNotEmpty(),
label = { Text(stringResource(MR.strings.btc_to_currency, state.defaultCurrencyCode)) },
singleLine = true,
visualTransformation = DigitGroupingTransformation,
modifier = Modifier.weight(1f),
)
}
if (!state.isManualSource) {
if (state.isLoading) {
@@ -216,13 +211,14 @@ fun PriceScreen(
val oneCurrencyToSats = state.oneCurrencyToSats()
if (oneCurrencyToSats.isNotEmpty()) {
Text(
text = stringResource(MR.strings.currency_to_sats, state.defaultCurrencyCode),
style = MaterialTheme.typography.bodyMedium,
)
Text(
text = groupDigits(oneCurrencyToSats),
style = MaterialTheme.typography.headlineSmall,
OutlinedTextField(
value = oneCurrencyToSats,
onValueChange = {},
readOnly = true,
label = { Text(stringResource(MR.strings.currency_to_sats, state.defaultCurrencyCode)) },
singleLine = true,
visualTransformation = DigitGroupingTransformation,
modifier = Modifier.fillMaxWidth(),
)
}
}