diff --git a/iosApp/iosApp/ContentView.swift b/iosApp/iosApp/ContentView.swift
index 53ed6eb..fc5ebe3 100644
--- a/iosApp/iosApp/ContentView.swift
+++ b/iosApp/iosApp/ContentView.swift
@@ -55,10 +55,6 @@ struct ContentView: View {
private func form(for state: IosConverterState) -> some View {
Form {
Section(
- header: Text(IosLocalizationKt.localizedFormattedString(
- resource: MR.strings.shared.btc_to_currency,
- args: [state.defaultCurrencyCode]
- )),
footer: Group {
if !state.statusLine.isEmpty {
Text(state.statusLine)
@@ -78,19 +74,22 @@ struct ContentView: View {
}
HStack {
+ Text(IosLocalizationKt.localizedFormattedString(
+ resource: MR.strings.shared.btc_to_currency,
+ args: [state.defaultCurrencyCode]
+ ))
+ Spacer()
if state.isManualSource {
NumericField(
- placeholder: IosLocalizationKt.localizedString(resource: MR.strings.shared.rate_label),
+ placeholder: "",
value: state.manualRateInput,
keyboardType: .decimalPad,
sanitize: sanitizeDecimalInput,
- onChange: { viewModel.onManualRateChanged($0) }
+ onChange: { viewModel.onManualRateChanged($0) },
+ alignment: .trailing
)
} else if !state.defaultCurrencyRate.isEmpty {
Text(NumberFormatKt.groupDigits(value: state.defaultCurrencyRate))
- Spacer()
- } else {
- Spacer()
}
if !state.isManualSource {
if state.isLoading {
diff --git a/shared/src/commonMain/kotlin/xyz/tyiu/satsprice/ui/PriceScreen.kt b/shared/src/commonMain/kotlin/xyz/tyiu/satsprice/ui/PriceScreen.kt
index d68e1d7..c949f2e 100644
--- a/shared/src/commonMain/kotlin/xyz/tyiu/satsprice/ui/PriceScreen.kt
+++ b/shared/src/commonMain/kotlin/xyz/tyiu/satsprice/ui/PriceScreen.kt
@@ -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(),
)
}
}
diff --git a/shared/src/commonMain/moko-resources/base/strings.xml b/shared/src/commonMain/moko-resources/base/strings.xml
index fdbb31f..4943d5f 100644
--- a/shared/src/commonMain/moko-resources/base/strings.xml
+++ b/shared/src/commonMain/moko-resources/base/strings.xml
@@ -2,7 +2,7 @@
Add currency
Bitcoin
BTC
- 1 BTC to %1$s
+ BTC to %1$s
Clear search
Currencies
%1$d selected
@@ -11,7 +11,7 @@
%1$s - %2$s
%1$s - %2$s
Options for %1$s
- 1 %1$s to Sats
+ %1$s to Sats
Done
Exceeds the %1$s maximum supply
Move down
@@ -19,7 +19,6 @@
Move to top
Move up
Price Source
- Rate
Refresh
Remove
Retry