Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make UI changes to hide amount #6761

Merged
merged 1 commit into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -112,7 +114,8 @@ class TokenSelectViewModel(
balanceViewItemFactory = BalanceViewItemFactory(),
balanceViewTypeManager = App.balanceViewTypeManager,
itemsFilter = null,
balanceSorter = BalanceSorter()
balanceSorter = BalanceSorter(),
balanceHiddenManager = App.balanceHiddenManager,
) as T
}
}
Expand All @@ -127,7 +130,8 @@ class TokenSelectViewModel(
itemsFilter = {
it.wallet.token.swappable
},
balanceSorter = BalanceSorter()
balanceSorter = BalanceSorter(),
balanceHiddenManager = App.balanceHiddenManager,
) as T
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -63,7 +64,8 @@ data class TransactionInfoItem(
val lastBlockInfo: LastBlockInfo?,
val explorerData: TransactionInfoModule.ExplorerData,
val rates: Map<String, CurrencyValue>,
val nftMetadata: Map<NftUid, NftAssetBriefMetadata>
val nftMetadata: Map<NftUid, NftAssetBriefMetadata>,
val hideAmount: Boolean,
)

val BlockchainType.resendable: Boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Loading