[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-taler-android] 07/15: [wallet] Set input digits of some amount in
From: |
gnunet |
Subject: |
[taler-taler-android] 07/15: [wallet] Set input digits of some amount inputs |
Date: |
Wed, 27 Mar 2024 18:27:10 +0100 |
This is an automated email from the git hooks/post-receive script.
torsten-grote pushed a commit to branch master
in repository taler-android.
commit 4b4cf989aa0bfb5e9223ced86242cdd51be47701
Author: Iván Ávalos <avalos@disroot.org>
AuthorDate: Tue Feb 20 14:45:03 2024 -0600
[wallet] Set input digits of some amount inputs
(cherry picked from commit acb03da41f452d85248effa7d7b6579541446b63)
---
wallet/src/main/java/net/taler/wallet/ReceiveFundsFragment.kt | 2 ++
wallet/src/main/java/net/taler/wallet/SendFundsFragment.kt | 2 ++
wallet/src/main/java/net/taler/wallet/compose/AmountInputField.kt | 4 +++-
3 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/wallet/src/main/java/net/taler/wallet/ReceiveFundsFragment.kt
b/wallet/src/main/java/net/taler/wallet/ReceiveFundsFragment.kt
index 7b9e985..da7e345 100644
--- a/wallet/src/main/java/net/taler/wallet/ReceiveFundsFragment.kt
+++ b/wallet/src/main/java/net/taler/wallet/ReceiveFundsFragment.kt
@@ -53,6 +53,7 @@ import androidx.navigation.fragment.findNavController
import net.taler.common.Amount
import net.taler.common.CurrencySpecification
import net.taler.wallet.compose.AmountInputField
+import net.taler.wallet.compose.DEFAULT_INPUT_DECIMALS
import net.taler.wallet.compose.TalerSurface
import net.taler.wallet.exchanges.ExchangeItem
@@ -149,6 +150,7 @@ private fun ReceiveFundsIntro(
if (isError)
Text(stringResource(R.string.receive_amount_invalid))
},
isError = isError,
+ numberOfDecimals = spec?.numFractionalInputDigits ?:
DEFAULT_INPUT_DECIMALS,
)
Text(
modifier = Modifier,
diff --git a/wallet/src/main/java/net/taler/wallet/SendFundsFragment.kt
b/wallet/src/main/java/net/taler/wallet/SendFundsFragment.kt
index e4df8d8..ab8fa07 100644
--- a/wallet/src/main/java/net/taler/wallet/SendFundsFragment.kt
+++ b/wallet/src/main/java/net/taler/wallet/SendFundsFragment.kt
@@ -50,6 +50,7 @@ import androidx.navigation.fragment.findNavController
import net.taler.common.Amount
import net.taler.common.CurrencySpecification
import net.taler.wallet.compose.AmountInputField
+import net.taler.wallet.compose.DEFAULT_INPUT_DECIMALS
import net.taler.wallet.compose.TalerSurface
class SendFundsFragment : Fragment() {
@@ -133,6 +134,7 @@ private fun SendFundsIntro(
}
},
isError = isError || insufficientBalance,
+ numberOfDecimals = spec?.numFractionalInputDigits ?:
DEFAULT_INPUT_DECIMALS,
)
Text(
modifier = Modifier,
diff --git a/wallet/src/main/java/net/taler/wallet/compose/AmountInputField.kt
b/wallet/src/main/java/net/taler/wallet/compose/AmountInputField.kt
index 077c89a..3d1d284 100644
--- a/wallet/src/main/java/net/taler/wallet/compose/AmountInputField.kt
+++ b/wallet/src/main/java/net/taler/wallet/compose/AmountInputField.kt
@@ -40,6 +40,8 @@ import kotlin.math.max
import kotlin.math.pow
import kotlin.math.roundToLong
+const val DEFAULT_INPUT_DECIMALS = 2
+
@Composable
fun AmountInputField(
value: String,
@@ -50,7 +52,7 @@ fun AmountInputField(
isError: Boolean = false,
keyboardActions: KeyboardActions = KeyboardActions.Default,
decimalFormatSymbols: DecimalFormatSymbols =
DecimalFormat().decimalFormatSymbols,
- numberOfDecimals: Int = 2,
+ numberOfDecimals: Int = DEFAULT_INPUT_DECIMALS,
) {
var amountInput by remember { mutableStateOf(value) }
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [taler-taler-android] branch master updated (39b6926 -> 4af27e7), gnunet, 2024/03/27
- [taler-taler-android] 04/15: [wallet] Balance layout improvements, gnunet, 2024/03/27
- [taler-taler-android] 05/15: [wallet] Display transactions by scopeInfo instead of currency, gnunet, 2024/03/27
- [taler-taler-android] 02/15: [wallet] DD51: enrich some tx amounts with currencySpecification, gnunet, 2024/03/27
- [taler-taler-android] 14/15: [wallet] Use Backend.json instead of Json, gnunet, 2024/03/27
- [taler-taler-android] 07/15: [wallet] Set input digits of some amount inputs,
gnunet <=
- [taler-taler-android] 01/15: [wallet] DD51: initial rendering based on currency spec, gnunet, 2024/03/27
- [taler-taler-android] 03/15: [wallet] DD51: enrich manual withdrawal amounts with currencySpecification, gnunet, 2024/03/27
- [taler-taler-android] 15/15: [wallet] Use TransactionManager.selectedScope instead of passing around scopeInfo, gnunet, 2024/03/27
- [taler-taler-android] 08/15: [wallet] Cache currencySpec in loadBalances(), gnunet, 2024/03/27
- [taler-taler-android] 10/15: [taler-android] Improve handling of currencies with no symbol, gnunet, 2024/03/27
- [taler-taler-android] 12/15: [wallet] Fix call to loadBalances() from non-UI thread, gnunet, 2024/03/27
- [taler-taler-android] 06/15: [wallet] Improve DD51 unit rendering and adapt tests accordingly, gnunet, 2024/03/27
- [taler-taler-android] 11/15: [wallet] Cache currency spec per scope info, gnunet, 2024/03/27
- [taler-taler-android] 13/15: [wallet] DD51'd more views, UX improvements and some fixes, gnunet, 2024/03/27
- [taler-taler-android] 09/15: [taler-android] Improved and refactored testToString test, gnunet, 2024/03/27