diff --git a/app/src/main/java/io/horizontalsystems/bankwallet/modules/balance/ui/BalanceCard.kt b/app/src/main/java/io/horizontalsystems/bankwallet/modules/balance/ui/BalanceCard.kt index 3c8ae6a6591..701a47b2403 100644 --- a/app/src/main/java/io/horizontalsystems/bankwallet/modules/balance/ui/BalanceCard.kt +++ b/app/src/main/java/io/horizontalsystems/bankwallet/modules/balance/ui/BalanceCard.kt @@ -180,14 +180,12 @@ fun BalanceCardInner( } } Spacer(Modifier.width(24.dp)) - if (viewItem.primaryValue.visible) { - Text( - text = viewItem.primaryValue.value, - color = if (viewItem.primaryValue.dimmed) ComposeAppTheme.colors.grey else ComposeAppTheme.colors.leah, - style = ComposeAppTheme.typography.headline2, - maxLines = 1, - ) - } + Text( + text = if (viewItem.primaryValue.visible) viewItem.primaryValue.value else "*****", + color = if (viewItem.primaryValue.dimmed) ComposeAppTheme.colors.grey else ComposeAppTheme.colors.leah, + style = ComposeAppTheme.typography.headline2, + maxLines = 1, + ) } Spacer(modifier = Modifier.height(3.dp)) @@ -239,9 +237,9 @@ fun BalanceCardInner( text = viewItem.syncedUntilTextValue, maxLines = 1, ) - } else if (viewItem.secondaryValue.visible) { + } else { Text( - text = viewItem.secondaryValue.value, + text = if (viewItem.secondaryValue.visible) viewItem.secondaryValue.value else "*****", color = if (viewItem.secondaryValue.dimmed) ComposeAppTheme.colors.grey50 else ComposeAppTheme.colors.grey, style = ComposeAppTheme.typography.subhead2, maxLines = 1, diff --git a/app/src/main/java/io/horizontalsystems/bankwallet/modules/tokenselect/TokenSelectViewModel.kt b/app/src/main/java/io/horizontalsystems/bankwallet/modules/tokenselect/TokenSelectViewModel.kt index d9e2f6a3837..899a8ea5ada 100644 --- a/app/src/main/java/io/horizontalsystems/bankwallet/modules/tokenselect/TokenSelectViewModel.kt +++ b/app/src/main/java/io/horizontalsystems/bankwallet/modules/tokenselect/TokenSelectViewModel.kt @@ -7,6 +7,7 @@ import androidx.lifecycle.ViewModel import androidx.lifecycle.ViewModelProvider import androidx.lifecycle.viewModelScope import io.horizontalsystems.bankwallet.core.App +import io.horizontalsystems.bankwallet.core.managers.BalanceHiddenManager import io.horizontalsystems.bankwallet.core.swappable import io.horizontalsystems.bankwallet.modules.balance.BalanceModule import io.horizontalsystems.bankwallet.modules.balance.BalanceService @@ -24,7 +25,8 @@ class TokenSelectViewModel( private val balanceViewItemFactory: BalanceViewItemFactory, private val balanceViewTypeManager: BalanceViewTypeManager, private val itemsFilter: ((BalanceModule.BalanceItem) -> Boolean)?, - private val balanceSorter: BalanceSorter + private val balanceSorter: BalanceSorter, + private val balanceHiddenManager: BalanceHiddenManager ) : ViewModel() { private var noItems = false @@ -70,7 +72,7 @@ class TokenSelectViewModel( balanceViewItemFactory.viewItem2( item = balanceItem, currency = service.baseCurrency, - hideBalance = false, + hideBalance = balanceHiddenManager.balanceHidden, watchAccount = service.isWatchAccount, balanceViewType = balanceViewTypeManager.balanceViewTypeFlow.value, networkAvailable = service.networkAvailable @@ -112,7 +114,8 @@ class TokenSelectViewModel( balanceViewItemFactory = BalanceViewItemFactory(), balanceViewTypeManager = App.balanceViewTypeManager, itemsFilter = null, - balanceSorter = BalanceSorter() + balanceSorter = BalanceSorter(), + balanceHiddenManager = App.balanceHiddenManager, ) as T } } @@ -127,7 +130,8 @@ class TokenSelectViewModel( itemsFilter = { it.wallet.token.swappable }, - balanceSorter = BalanceSorter() + balanceSorter = BalanceSorter(), + balanceHiddenManager = App.balanceHiddenManager, ) as T } } diff --git a/app/src/main/java/io/horizontalsystems/bankwallet/modules/transactionInfo/TransactionInfoModule.kt b/app/src/main/java/io/horizontalsystems/bankwallet/modules/transactionInfo/TransactionInfoModule.kt index 845f730b75a..9cd2456f105 100644 --- a/app/src/main/java/io/horizontalsystems/bankwallet/modules/transactionInfo/TransactionInfoModule.kt +++ b/app/src/main/java/io/horizontalsystems/bankwallet/modules/transactionInfo/TransactionInfoModule.kt @@ -29,7 +29,8 @@ object TransactionInfoModule { adapter, App.marketKit, App.currencyManager, - NftMetadataService(App.nftMetadataManager) + NftMetadataService(App.nftMetadataManager), + App.balanceHiddenManager.balanceHidden, ) val factory = TransactionInfoViewItemFactory( App.numberFormatter, @@ -63,7 +64,8 @@ data class TransactionInfoItem( val lastBlockInfo: LastBlockInfo?, val explorerData: TransactionInfoModule.ExplorerData, val rates: Map, - val nftMetadata: Map + val nftMetadata: Map, + val hideAmount: Boolean, ) val BlockchainType.resendable: Boolean diff --git a/app/src/main/java/io/horizontalsystems/bankwallet/modules/transactionInfo/TransactionInfoService.kt b/app/src/main/java/io/horizontalsystems/bankwallet/modules/transactionInfo/TransactionInfoService.kt index e23820206fb..fb97334ddae 100644 --- a/app/src/main/java/io/horizontalsystems/bankwallet/modules/transactionInfo/TransactionInfoService.kt +++ b/app/src/main/java/io/horizontalsystems/bankwallet/modules/transactionInfo/TransactionInfoService.kt @@ -47,7 +47,8 @@ class TransactionInfoService( private val adapter: ITransactionsAdapter, private val marketKit: MarketKitWrapper, private val currencyManager: CurrencyManager, - private val nftMetadataService: NftMetadataService + private val nftMetadataService: NftMetadataService, + balanceHidden: Boolean, ) { val transactionHash: String get() = transactionRecord.transactionHash @@ -61,7 +62,8 @@ class TransactionInfoService( adapter.lastBlockInfo, TransactionInfoModule.ExplorerData(adapter.explorerTitle, adapter.getTransactionUrl(transactionRecord.transactionHash)), mapOf(), - mapOf() + mapOf(), + balanceHidden ) private set(value) { field = value diff --git a/app/src/main/java/io/horizontalsystems/bankwallet/modules/transactionInfo/TransactionInfoViewItemFactory.kt b/app/src/main/java/io/horizontalsystems/bankwallet/modules/transactionInfo/TransactionInfoViewItemFactory.kt index ed5f8833553..8e4d772ec87 100644 --- a/app/src/main/java/io/horizontalsystems/bankwallet/modules/transactionInfo/TransactionInfoViewItemFactory.kt +++ b/app/src/main/java/io/horizontalsystems/bankwallet/modules/transactionInfo/TransactionInfoViewItemFactory.kt @@ -90,18 +90,20 @@ class TransactionInfoViewItemFactory( is EvmIncomingTransactionRecord -> itemSections.add( getReceiveSectionItems( - transaction.value, - transaction.from, - rates[transaction.value.coinUid] + value = transaction.value, + fromAddress = transaction.from, + coinPrice = rates[transaction.value.coinUid], + hideAmount = transactionItem.hideAmount, ) ) is TronIncomingTransactionRecord -> itemSections.add( getReceiveSectionItems( - transaction.value, - transaction.from, - rates[transaction.value.coinUid] + value = transaction.value, + fromAddress = transaction.from, + coinPrice = rates[transaction.value.coinUid], + hideAmount = transactionItem.hideAmount, ) ) @@ -109,11 +111,12 @@ class TransactionInfoViewItemFactory( sentToSelf = transaction.sentToSelf itemSections.add( getSendSectionItems( - transaction.value, - transaction.to, - rates[transaction.value.coinUid], - transaction.sentToSelf, - nftMetadata + value = transaction.value, + toAddress = transaction.to, + coinPrice = rates[transaction.value.coinUid], + hideAmount = transactionItem.hideAmount, + sentToSelf = transaction.sentToSelf, + nftMetadata = nftMetadata ) ) } @@ -122,11 +125,12 @@ class TransactionInfoViewItemFactory( sentToSelf = transaction.sentToSelf itemSections.add( getSendSectionItems( - transaction.value, - transaction.to, - rates[transaction.value.coinUid], - transaction.sentToSelf, - nftMetadata + value = transaction.value, + toAddress = transaction.to, + coinPrice = rates[transaction.value.coinUid], + hideAmount = transactionItem.hideAmount, + sentToSelf = transaction.sentToSelf, + nftMetadata = nftMetadata ) ) } @@ -135,15 +139,25 @@ class TransactionInfoViewItemFactory( val valueIn = transaction.valueIn val valueOut = transaction.valueOut - itemSections.add(getSwapEventSectionItems(getYouPayString(status), valueIn, transaction.amountIn, rates[valueIn.coinUid], false)) + itemSections.add( + getSwapEventSectionItems( + title = getYouPayString(status), + value = valueIn, + amount = transaction.amountIn, + rate = rates[valueIn.coinUid], + incoming = false, + hideAmount = transactionItem.hideAmount, + ) + ) if (valueOut != null) { val youGetSectionItems = getSwapEventSectionItems( - getYouGetString(status), - valueOut, - transaction.amountOut, - rates[valueOut.coinUid], - true + title = getYouGetString(status), + value = valueOut, + amount = transaction.amountOut, + rate = rates[valueOut.coinUid], + incoming = true, + hideAmount = transactionItem.hideAmount, ).toMutableList() val recipient = transaction.recipient @@ -172,31 +186,79 @@ class TransactionInfoViewItemFactory( val valueOut = transaction.valueOut if (valueIn != null) { - itemSections.add(getSwapEventSectionItems(getYouPayString(status), valueIn, null, rates[valueIn.coinUid], false)) + itemSections.add( + getSwapEventSectionItems( + title = getYouPayString(status), + value = valueIn, + amount = null, + rate = rates[valueIn.coinUid], + incoming = false, + hideAmount = transactionItem.hideAmount, + ) + ) } if (valueOut != null) { - itemSections.add(getSwapEventSectionItems(getYouGetString(status), valueOut, null, rates[valueOut.coinUid], true)) + itemSections.add( + getSwapEventSectionItems( + title = getYouGetString(status), + value = valueOut, + amount = null, + rate = rates[valueOut.coinUid], + incoming = true, + hideAmount = transactionItem.hideAmount, + ) + ) } itemSections.add(getSwapDetailsSectionItems(rates, transaction.exchangeAddress, valueOut, valueIn)) } is ApproveTransactionRecord -> - itemSections.add(getApproveSectionItems(transaction.value, rates[transaction.value.coinUid], transaction.spender)) + itemSections.add( + getApproveSectionItems( + value = transaction.value, + coinPrice = rates[transaction.value.coinUid], + spenderAddress = transaction.spender, + hideAmount = transactionItem.hideAmount, + ) + ) is TronApproveTransactionRecord -> - itemSections.add(getApproveSectionItems(transaction.value, rates[transaction.value.coinUid], transaction.spender)) + itemSections.add( + getApproveSectionItems( + value = transaction.value, + coinPrice = rates[transaction.value.coinUid], + spenderAddress = transaction.spender, + hideAmount = transactionItem.hideAmount, + ) + ) is ContractCallTransactionRecord -> { itemSections.add(getContractMethodSectionItems(transaction.method, transaction.contractAddress, transaction.blockchainType)) for (event in transaction.outgoingEvents) { - itemSections.add(getSendSectionItems(event.value, event.address, rates[event.value.coinUid], nftMetadata = nftMetadata)) + itemSections.add( + getSendSectionItems( + value = event.value, + toAddress = event.address, + coinPrice = rates[event.value.coinUid], + hideAmount = transactionItem.hideAmount, + nftMetadata = nftMetadata + ) + ) } for (event in transaction.incomingEvents) { - itemSections.add(getReceiveSectionItems(event.value, event.address, rates[event.value.coinUid], nftMetadata = nftMetadata)) + itemSections.add( + getReceiveSectionItems( + value = event.value, + fromAddress = event.address, + coinPrice = rates[event.value.coinUid], + hideAmount = transactionItem.hideAmount, + nftMetadata = nftMetadata + ) + ) } } @@ -204,31 +266,79 @@ class TransactionInfoViewItemFactory( itemSections.add(getContractMethodSectionItems(transaction.method, transaction.contractAddress, transaction.blockchainType)) for (event in transaction.outgoingEvents) { - itemSections.add(getSendSectionItems(event.value, event.address, rates[event.value.coinUid], nftMetadata = nftMetadata)) + itemSections.add( + getSendSectionItems( + value = event.value, + toAddress = event.address, + coinPrice = rates[event.value.coinUid], + hideAmount = transactionItem.hideAmount, + nftMetadata = nftMetadata + ) + ) } for (event in transaction.incomingEvents) { - itemSections.add(getReceiveSectionItems(event.value, event.address, rates[event.value.coinUid], nftMetadata = nftMetadata)) + itemSections.add( + getReceiveSectionItems( + value = event.value, + fromAddress = event.address, + coinPrice = rates[event.value.coinUid], + hideAmount = transactionItem.hideAmount, + nftMetadata = nftMetadata + ) + ) } } is ExternalContractCallTransactionRecord -> { for (event in transaction.outgoingEvents) { - itemSections.add(getSendSectionItems(event.value, event.address, rates[event.value.coinUid], nftMetadata = nftMetadata)) + itemSections.add( + getSendSectionItems( + value = event.value, + toAddress = event.address, + coinPrice = rates[event.value.coinUid], + hideAmount = transactionItem.hideAmount, + nftMetadata = nftMetadata + ) + ) } for (event in transaction.incomingEvents) { - itemSections.add(getReceiveSectionItems(event.value, event.address, rates[event.value.coinUid], nftMetadata = nftMetadata)) + itemSections.add( + getReceiveSectionItems( + value = event.value, + fromAddress = event.address, + coinPrice = rates[event.value.coinUid], + hideAmount = transactionItem.hideAmount, + nftMetadata = nftMetadata + ) + ) } } is TronExternalContractCallTransactionRecord -> { for (event in transaction.outgoingEvents) { - itemSections.add(getSendSectionItems(event.value, event.address, rates[event.value.coinUid], nftMetadata = nftMetadata)) + itemSections.add( + getSendSectionItems( + value = event.value, + toAddress = event.address, + coinPrice = rates[event.value.coinUid], + hideAmount = transactionItem.hideAmount, + nftMetadata = nftMetadata + ) + ) } for (event in transaction.incomingEvents) { - itemSections.add(getReceiveSectionItems(event.value, event.address, rates[event.value.coinUid], nftMetadata = nftMetadata)) + itemSections.add( + getReceiveSectionItems( + value = event.value, + fromAddress = event.address, + coinPrice = rates[event.value.coinUid], + hideAmount = transactionItem.hideAmount, + nftMetadata = nftMetadata + ) + ) } } @@ -245,7 +355,14 @@ class TransactionInfoViewItemFactory( } is BitcoinIncomingTransactionRecord -> { - itemSections.add(getReceiveSectionItems(transaction.value, transaction.from, rates[transaction.value.coinUid])) + itemSections.add( + getReceiveSectionItems( + value = transaction.value, + fromAddress = transaction.from, + coinPrice = rates[transaction.value.coinUid], + hideAmount = transactionItem.hideAmount, + ) + ) miscItemsSection.addAll(getBitcoinSectionItems(transaction, transactionItem.lastBlockInfo)) addMemoItem(transaction.memo, miscItemsSection) @@ -260,7 +377,14 @@ class TransactionInfoViewItemFactory( } is BinanceChainIncomingTransactionRecord -> { - itemSections.add(getReceiveSectionItems(transaction.value, transaction.from, rates[transaction.value.coinUid])) + itemSections.add( + getReceiveSectionItems( + value = transaction.value, + fromAddress = transaction.from, + coinPrice = rates[transaction.value.coinUid], + hideAmount = transactionItem.hideAmount, + ) + ) addMemoItem(transaction.memo, miscItemsSection) } @@ -269,10 +393,11 @@ class TransactionInfoViewItemFactory( sentToSelf = transaction.sentToSelf itemSections.add( getSendSectionItems( - transaction.value, - transaction.to, - rates[transaction.value.coinUid], - transaction.sentToSelf + value = transaction.value, + toAddress = transaction.to, + coinPrice = rates[transaction.value.coinUid], + hideAmount = transactionItem.hideAmount, + sentToSelf = transaction.sentToSelf, ) ) @@ -282,10 +407,11 @@ class TransactionInfoViewItemFactory( is SolanaIncomingTransactionRecord -> itemSections.add( getReceiveSectionItems( - transaction.value, - transaction.from, - rates[transaction.value.coinUid], - nftMetadata + value = transaction.value, + fromAddress = transaction.from, + coinPrice = rates[transaction.value.coinUid], + hideAmount = transactionItem.hideAmount, + nftMetadata = nftMetadata ) ) @@ -293,22 +419,39 @@ class TransactionInfoViewItemFactory( sentToSelf = transaction.sentToSelf itemSections.add( getSendSectionItems( - transaction.value, - transaction.to, - rates[transaction.value.coinUid], - transaction.sentToSelf, - nftMetadata + value = transaction.value, + toAddress = transaction.to, + coinPrice = rates[transaction.value.coinUid], + hideAmount = transactionItem.hideAmount, + sentToSelf = transaction.sentToSelf, + nftMetadata = nftMetadata ) ) } is SolanaUnknownTransactionRecord -> { for (transfer in transaction.outgoingTransfers) { - itemSections.add(getSendSectionItems(transfer.value, transfer.address, rates[transfer.value.coinUid], nftMetadata = nftMetadata)) + itemSections.add( + getSendSectionItems( + value = transfer.value, + toAddress = transfer.address, + coinPrice = rates[transfer.value.coinUid], + hideAmount = transactionItem.hideAmount, + nftMetadata = nftMetadata + ) + ) } for (transfer in transaction.incomingTransfers) { - itemSections.add(getReceiveSectionItems(transfer.value, transfer.address, rates[transfer.value.coinUid], nftMetadata = nftMetadata)) + itemSections.add( + getReceiveSectionItems( + value = transfer.value, + fromAddress = transfer.address, + coinPrice = rates[transfer.value.coinUid], + hideAmount = transactionItem.hideAmount, + nftMetadata = nftMetadata + ) + ) } } @@ -350,6 +493,7 @@ class TransactionInfoViewItemFactory( value: TransactionValue, fromAddress: String?, coinPrice: CurrencyValue?, + hideAmount: Boolean, nftMetadata: Map = mapOf() ): List { val mint = fromAddress == zeroAddress @@ -362,12 +506,13 @@ class TransactionInfoViewItemFactory( when (value) { is TransactionValue.NftValue -> { subtitle = getFullName(value, nftMetadata[value.nftUid]) - amount = getNftAmount(value, true, nftMetadata[value.nftUid]) + amount = getNftAmount(value, true, hideAmount, nftMetadata[value.nftUid]) rate = null } + else -> { subtitle = getFullName(value) - amount = getAmount(coinPrice, value, true) + amount = getAmount(coinPrice, value, true, hideAmount) rate = getHistoricalRate(coinPrice, value) } } @@ -406,6 +551,7 @@ class TransactionInfoViewItemFactory( } } ?: "#${transactionValue.nftUid.tokenId}" } + is TransactionValue.RawValue -> "" } @@ -413,6 +559,7 @@ class TransactionInfoViewItemFactory( value: TransactionValue, toAddress: String?, coinPrice: CurrencyValue?, + hideAmount: Boolean, sentToSelf: Boolean = false, nftMetadata: Map = mapOf() ): List { @@ -427,12 +574,13 @@ class TransactionInfoViewItemFactory( when (value) { is TransactionValue.NftValue -> { subtitle = getFullName(value, nftMetadata[value.nftUid]) - amount = getNftAmount(value, if (sentToSelf) null else false, nftMetadata[value.nftUid]) + amount = getNftAmount(value, if (sentToSelf) null else false, hideAmount, nftMetadata[value.nftUid]) rate = null } + else -> { subtitle = getFullName(value) - amount = getAmount(coinPrice, value, if (sentToSelf) null else false) + amount = getAmount(coinPrice, value, if (sentToSelf) null else false, hideAmount) rate = getHistoricalRate(coinPrice, value) } } @@ -463,7 +611,8 @@ class TransactionInfoViewItemFactory( value: TransactionValue, amount: SwapTransactionRecord.Amount?, rate: CurrencyValue?, - incoming: Boolean + incoming: Boolean, + hideAmount: Boolean, ): List = listOf( Transaction( @@ -471,7 +620,7 @@ class TransactionInfoViewItemFactory( value.fullName, icon = if (incoming) R.drawable.ic_arrow_down_left_12 else R.drawable.ic_arrow_up_right_12 ), - getAmount(rate, value, incoming, amount) + getAmount(rate, value, incoming, hideAmount, amount) ) private fun getSwapDetailsSectionItems( @@ -536,7 +685,12 @@ class TransactionInfoViewItemFactory( ) ) - private fun getApproveSectionItems(value: TransactionValue, coinPrice: CurrencyValue?, spenderAddress: String): List { + private fun getApproveSectionItems( + value: TransactionValue, + coinPrice: CurrencyValue?, + spenderAddress: String, + hideAmount: Boolean, + ): List { val fiatAmountFormatted = coinPrice?.let { value.decimalValue?.let { decimalValue -> numberFormatter.formatFiatFull( @@ -554,16 +708,25 @@ class TransactionInfoViewItemFactory( ) } ?: "" - val coinAmountString = if (value.isMaxValue) translator.getString( - R.string.Transaction_Unlimited, - value.coinCode - ) else coinAmountFormatted + val coinAmountString = when { + hideAmount -> "*****" + value.isMaxValue -> translator.getString( + R.string.Transaction_Unlimited, + value.coinCode + ) + + else -> coinAmountFormatted + } val coinAmountColoredValue = ColoredValue(coinAmountString, getAmountColor(null)) - val fiatAmountColoredValue = ColoredValue( - if (value.isMaxValue) "∞" else fiatAmountFormatted, - ColorName.Grey - ) + + val fiatAmountString = when { + hideAmount -> "*****" + value.isMaxValue -> "∞" + else -> fiatAmountFormatted + } + + val fiatAmountColoredValue = ColoredValue(fiatAmountString, ColorName.Grey) val contact = getContact(spenderAddress) @@ -715,9 +878,10 @@ class TransactionInfoViewItemFactory( rate: CurrencyValue?, value: TransactionValue, incoming: Boolean?, + hideAmount: Boolean, amount: SwapTransactionRecord.Amount? = null ): TransactionInfoViewItem { - val valueInFiat = rate?.let { + val valueInFiat = if (hideAmount) "*****" else rate?.let { value.decimalValue?.let { decimalValue -> numberFormatter.formatFiatFull( (it.value * decimalValue).abs(), @@ -726,7 +890,7 @@ class TransactionInfoViewItemFactory( } } ?: "---" val fiatValueColored = ColoredValue(valueInFiat, ColorName.Grey) - val coinValueFormatted = value.decimalValue?.let { decimalValue -> + val coinValueFormatted = if (hideAmount) "*****" else value.decimalValue?.let { decimalValue -> val sign = when { incoming == null -> "" decimalValue < BigDecimal.ZERO -> "-" @@ -754,9 +918,10 @@ class TransactionInfoViewItemFactory( private fun getNftAmount( value: TransactionValue.NftValue, incoming: Boolean?, + hideAmount: Boolean, nftMetadata: NftAssetBriefMetadata? ): TransactionInfoViewItem { - val valueFormatted = value.decimalValue.let { decimalValue -> + val valueFormatted = if (hideAmount) "*****" else value.decimalValue.let { decimalValue -> val sign = when { incoming == null -> "" decimalValue < BigDecimal.ZERO -> "-" diff --git a/app/src/main/java/io/horizontalsystems/bankwallet/modules/transactions/TransactionsScreen.kt b/app/src/main/java/io/horizontalsystems/bankwallet/modules/transactions/TransactionsScreen.kt index 25d66a0a20b..21bb58fa635 100644 --- a/app/src/main/java/io/horizontalsystems/bankwallet/modules/transactions/TransactionsScreen.kt +++ b/app/src/main/java/io/horizontalsystems/bankwallet/modules/transactions/TransactionsScreen.kt @@ -359,16 +359,14 @@ fun TransactionCell(item: TransactionViewItem, position: SectionItemPosition, on maxLines = 1, ) Spacer(Modifier.weight(1f)) - if (item.showAmount) { - item.primaryValue?.let { coloredValue -> - Text( - text = coloredValue.value, - style = ComposeAppTheme.typography.body, - color = coloredValue.color.compose(), - overflow = TextOverflow.Ellipsis, - maxLines = 1, - ) - } + item.primaryValue?.let { coloredValue -> + Text( + text = if (item.showAmount) coloredValue.value else "*****", + style = ComposeAppTheme.typography.body, + color = coloredValue.color.compose(), + overflow = TextOverflow.Ellipsis, + maxLines = 1, + ) } if (item.doubleSpend) { @@ -402,15 +400,13 @@ fun TransactionCell(item: TransactionViewItem, position: SectionItemPosition, on .padding(end = 8.dp), maxLines = 2, ) - if (item.showAmount) { - item.secondaryValue?.let { coloredValue -> - Text( - text = coloredValue.value, - style = ComposeAppTheme.typography.subhead2, - color = coloredValue.color.compose(), - maxLines = 1, - ) - } + item.secondaryValue?.let { coloredValue -> + Text( + text = if (item.showAmount) coloredValue.value else "*****", + style = ComposeAppTheme.typography.subhead2, + color = coloredValue.color.compose(), + maxLines = 1, + ) } } }