commit 98181c8e121d4ec565d8c2fd215dabde7be1eff3 parent 7c4acb137b850adb1dd01428926cdbd907778dc1 Author: Iván Ávalos <avalos@disroot.org> Date: Wed, 10 Dec 2025 08:26:03 +0100 [wallet] improved amount field text style Diffstat:
3 files changed, 16 insertions(+), 8 deletions(-)
diff --git a/wallet/src/main/java/net/taler/wallet/compose/AmountInputFIeld.kt b/wallet/src/main/java/net/taler/wallet/compose/AmountInputFIeld.kt @@ -60,7 +60,6 @@ import androidx.compose.ui.platform.LocalFocusManager import androidx.compose.ui.platform.LocalTextInputService import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.InternalTextApi -import androidx.compose.ui.text.font.FontFamily import androidx.compose.ui.text.input.BackspaceCommand import androidx.compose.ui.text.input.CommitTextCommand import androidx.compose.ui.text.input.DeleteSurroundingTextCommand @@ -291,7 +290,7 @@ internal fun AmountInputFieldBase( }, readOnly = true, textStyle = LocalTextStyle.current.copy( - fontFamily = FontFamily.Monospace, + fontSize = MaterialTheme.typography.titleLarge.fontSize, ), label = label, supportingText = supportingText, diff --git a/wallet/src/main/java/net/taler/wallet/withdraw/PromptWithdrawFragment.kt b/wallet/src/main/java/net/taler/wallet/withdraw/PromptWithdrawFragment.kt @@ -133,10 +133,11 @@ class PromptWithdrawFragment: Fragment() { WithdrawalShowInfo( status = s, devMode = devMode ?: false, - initialAmountScope = AmountScope( - amount = initialAmount, - scope = initialScope, - ), + initialAmountScope = status.selectedAmount?.let { amount -> + status.selectedScope?.let { scope -> + AmountScope(amount, scope) + } + }, editableScope = editableCurrency, scopes = scopes, onSelectExchange = { selectExchange() }, diff --git a/wallet/src/main/java/net/taler/wallet/withdraw/WithdrawalShowInfo.kt b/wallet/src/main/java/net/taler/wallet/withdraw/WithdrawalShowInfo.kt @@ -77,7 +77,7 @@ import net.taler.wallet.withdraw.WithdrawalOperationStatusFlag.Pending fun WithdrawalShowInfo( status: WithdrawStatus, devMode: Boolean, - initialAmountScope: AmountScope, + initialAmountScope: AmountScope?, editableScope: Boolean, scopes: List<ScopeInfo>, onSelectAmount: (amount: Amount, scope: ScopeInfo) -> Unit, @@ -93,7 +93,15 @@ fun WithdrawalShowInfo( val ageRestrictionOptions = status.amountInfo?.ageRestrictionOptions ?: emptyList() val keyboardController = LocalSoftwareKeyboardController.current - var selectedAmount by remember(initialAmountScope) { mutableStateOf(initialAmountScope) } + var selectedAmount by remember(initialAmountScope != null) { + mutableStateOf(initialAmountScope + ?: AmountScope( + amount = Amount.zero(scopes.first().currency), + scope = scopes.first(), + userInput = false, + ), + ) + } var selectedAge by remember { mutableStateOf<Int?>(null) } val scrollState = rememberScrollState() val insufficientBalance = remember(selectedAmount, maxAmount) {