Updated on 2026-08-14

This commit is contained in:
Tangem 2025-02-04 15:26:02 +04:00
parent 3113cfe26f
commit f9bd500ada
8 changed files with 15 additions and 2 deletions

View file

@ -36,6 +36,7 @@ internal object WalletPreviewData {
onDeleteClick = {},
cardCount = 1,
isZeroBalance = false,
isBalanceFlickering = false,
)
}

View file

@ -1,5 +1,6 @@
package com.tangem.feature.wallet.presentation.common.preview
import com.tangem.core.ui.components.containers.pullToRefresh.PullToRefreshConfig
import com.tangem.core.ui.components.currency.icon.CurrencyIconState
import com.tangem.core.ui.components.marketprice.PriceChangeType
import com.tangem.core.ui.components.token.state.TokenItemState
@ -7,7 +8,6 @@ import com.tangem.core.ui.components.tokenlist.state.TokensListItemUM
import com.tangem.core.ui.event.consumedEvent
import com.tangem.core.ui.extensions.TextReference
import com.tangem.core.ui.extensions.stringReference
import com.tangem.core.ui.components.containers.pullToRefresh.PullToRefreshConfig
import com.tangem.domain.wallets.models.UserWalletId
import com.tangem.feature.wallet.impl.R
import com.tangem.feature.wallet.presentation.common.WalletPreviewData.topBarConfig
@ -105,6 +105,7 @@ internal object WalletScreenPreviewData {
onRenameClick = { _ -> },
onDeleteClick = {},
isZeroBalance = false,
isBalanceFlickering = false,
)
}
private val multiWalletState by lazy {

View file

@ -48,6 +48,7 @@ internal sealed interface WalletCardState {
override val imageResId: Int?,
override val onRenameClick: (UserWalletId) -> Unit,
override val onDeleteClick: (UserWalletId) -> Unit,
val isBalanceFlickering: Boolean,
val cardCount: Int?,
val balance: String,
val isZeroBalance: Boolean?,

View file

@ -78,6 +78,7 @@ internal class SetBalancesAndLimitsTransformer(
},
cardCount = userWallet.getCardsCount(),
isZeroBalance = visaCurrency.balances.available.isZero(),
isBalanceFlickering = false, // TODO: Implement in [REDACTED_JIRA]
)
}
}

View file

@ -69,6 +69,7 @@ internal class SetTokenListErrorTransformer(
),
cardCount = selectedWallet.getCardsCount(),
isZeroBalance = true,
isBalanceFlickering = false, // TODO: Implement in [REDACTED_JIRA]
)
}
}

View file

@ -61,6 +61,7 @@ internal class MultiWalletCardStateConverter(
),
isZeroBalance = fiatBalance.amount.isZero(),
cardCount = selectedWallet.getCardsCount(),
isBalanceFlickering = false, // TODO: Implement in [REDACTED_JIRA]
)
}
}

View file

@ -65,6 +65,7 @@ internal class SingleWalletCardStateConverter(
balance = formatFiatAmount(status = status, appCurrency = appCurrency),
cardCount = selectedWallet.getCardsCount(),
isZeroBalance = status.fiatAmount?.isZero(),
isBalanceFlickering = false, // TODO: Implement in [REDACTED_JIRA]
)
}

View file

@ -44,6 +44,7 @@ import androidx.constraintlayout.compose.Dimension
import com.tangem.core.ui.components.FontSizeRange
import com.tangem.core.ui.components.RectangleShimmer
import com.tangem.core.ui.components.ResizableText
import com.tangem.core.ui.components.flicker
import com.tangem.core.ui.extensions.TextReference
import com.tangem.core.ui.extensions.orMaskWithStars
import com.tangem.core.ui.extensions.resolveReference
@ -289,9 +290,11 @@ private fun Balance(state: WalletCardState, isBalanceHidden: Boolean, modifier:
when (walletCardState) {
is WalletCardState.Content -> {
ResizableText(
modifier = Modifier
.defaultMinSize(minHeight = TangemTheme.dimens.size32)
.flicker(isFlickering = walletCardState.isBalanceFlickering),
text = walletCardState.balance.orMaskWithStars(isBalanceHidden),
fontSizeRange = FontSizeRange(min = 16.sp, max = TangemTheme.typography.h2.fontSize),
modifier = Modifier.defaultMinSize(minHeight = TangemTheme.dimens.size32),
color = TangemTheme.colors.text.primary1,
overflow = TextOverflow.Ellipsis,
maxLines = 1,
@ -401,6 +404,9 @@ private fun Preview_WalletCard(
private class WalletCardStateProvider : CollectionPreviewParameterProvider<WalletCardState>(
collection = listOf(
WalletPreviewData.walletCardContentState,
WalletPreviewData.walletCardContentState.copy(
isBalanceFlickering = true,
),
WalletPreviewData.walletCardLoadingState,
WalletPreviewData.walletCardErrorState,
),