taler-android

Android apps for GNU Taler (wallet, PoS, cashier)
Log | Files | Refs | README | LICENSE

commit 38e11f2811cb5fe68a0c64c94f4ae6c3036a88ee
parent 06f9502134a10bc55d799ea1ddd63b3c52c2e0a1
Author: Iván Ávalos <avalos@disroot.org>
Date:   Wed, 30 Apr 2025 22:20:59 +0200

[wallet] only allow changing withdrawal provider in devMode

Diffstat:
Mwallet/src/main/java/net/taler/wallet/withdraw/PromptWithdrawFragment.kt | 4++++
Mwallet/src/main/java/net/taler/wallet/withdraw/WithdrawalShowInfo.kt | 3++-
2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/wallet/src/main/java/net/taler/wallet/withdraw/PromptWithdrawFragment.kt b/wallet/src/main/java/net/taler/wallet/withdraw/PromptWithdrawFragment.kt @@ -28,6 +28,7 @@ import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.getValue +import androidx.compose.runtime.livedata.observeAsState import androidx.compose.runtime.remember import androidx.compose.ui.Alignment.Companion.Center import androidx.compose.ui.Modifier @@ -95,6 +96,7 @@ class PromptWithdrawFragment: Fragment() { setContent { val status by withdrawManager.withdrawStatus.collectAsStateLifecycleAware() + val devMode by model.devMode.observeAsState() val exchange by remember(status.exchangeBaseUrl) { status.exchangeBaseUrl @@ -153,6 +155,7 @@ class PromptWithdrawFragment: Fragment() { // TODO: use scopeInfo instead of currency! WithdrawalShowInfo( status = s, + devMode = devMode ?: false, defaultCurrency = defaultCurrency, editableCurrency = editableCurrency, currencies = currencies, @@ -344,6 +347,7 @@ fun WithdrawalShowInfoPreview() { ), ) ), + devMode = true, defaultCurrency = "KUDOS", editableCurrency = true, currencies = listOf("KUDOS", "TESTKUDOS", "NETZBON"), diff --git a/wallet/src/main/java/net/taler/wallet/withdraw/WithdrawalShowInfo.kt b/wallet/src/main/java/net/taler/wallet/withdraw/WithdrawalShowInfo.kt @@ -65,6 +65,7 @@ import net.taler.wallet.withdraw.WithdrawStatus.Status.Updating @Composable fun WithdrawalShowInfo( status: WithdrawStatus, + devMode: Boolean, defaultCurrency: String, editableCurrency: Boolean, currencies: List<String>, @@ -182,7 +183,7 @@ fun WithdrawalShowInfo( label = stringResource(R.string.withdraw_exchange), info = cleanExchange(it), trailing = { - if (possibleExchanges.size > 1) { + if (devMode && possibleExchanges.size > 1) { IconButton( modifier = Modifier.padding(start = 8.dp), onClick = { onSelectExchange() },