Updated on 2026-08-14
This commit is contained in:
parent
9c8bfd4139
commit
0896f80f53
30 changed files with 483 additions and 263 deletions
|
|
@ -15,6 +15,7 @@ import androidx.compose.ui.res.painterResource
|
|||
import com.tangem.core.ui.R
|
||||
import com.tangem.core.ui.components.account.AccountCharIcon
|
||||
import com.tangem.core.ui.components.account.AccountResIcon
|
||||
import com.tangem.core.ui.components.account.PaymentAccountIcon
|
||||
import com.tangem.core.ui.components.currency.DefaultCurrencyIcon
|
||||
import com.tangem.core.ui.extensions.resolveReference
|
||||
import com.tangem.core.ui.res.TangemTheme
|
||||
|
|
@ -61,6 +62,7 @@ internal fun ContentIcon(
|
|||
background = icon.background,
|
||||
alpha = alpha,
|
||||
)
|
||||
is CurrencyIconState.PaymentAccount -> PaymentAccountIcon(modifier = modifier, size = icon.size)
|
||||
is CurrencyIconState.CryptoPortfolio.Icon -> AccountResIcon(
|
||||
modifier = modifier,
|
||||
resId = icon.resId,
|
||||
|
|
|
|||
|
|
@ -62,6 +62,7 @@ fun CurrencyIcon(
|
|||
is CurrencyIconState.FiatIcon,
|
||||
is CurrencyIconState.CustomTokenIcon,
|
||||
is CurrencyIconState.TokenIcon,
|
||||
is CurrencyIconState.PaymentAccount,
|
||||
is CurrencyIconState.CryptoPortfolio.Icon,
|
||||
is CurrencyIconState.CryptoPortfolio.Letter,
|
||||
-> {
|
||||
|
|
|
|||
|
|
@ -88,6 +88,12 @@ sealed class CurrencyIconState {
|
|||
override val topBadgeIconResId: Int? = null
|
||||
}
|
||||
|
||||
data class PaymentAccount(val size: AccountIconSize = AccountIconSize.Default) : CurrencyIconState() {
|
||||
override val isGrayscale: Boolean = false
|
||||
override val shouldShowCustomBadge: Boolean = false
|
||||
override val topBadgeIconResId: Int? = null
|
||||
}
|
||||
|
||||
@Immutable
|
||||
sealed class CryptoPortfolio : CurrencyIconState() {
|
||||
override val shouldShowCustomBadge: Boolean = false
|
||||
|
|
@ -155,6 +161,7 @@ sealed class CurrencyIconState {
|
|||
is CryptoPortfolio.Letter -> copy(
|
||||
isGrayscale = isGrayscale,
|
||||
)
|
||||
is PaymentAccount,
|
||||
is Loading,
|
||||
is Locked,
|
||||
is Empty,
|
||||
|
|
|
|||
|
|
@ -2,7 +2,8 @@ package com.tangem.core.ui.components.tokenlist
|
|||
|
||||
import androidx.compose.animation.*
|
||||
import androidx.compose.animation.SharedTransitionScope.ResizeMode.Companion.scaleToBounds
|
||||
import androidx.compose.animation.core.*
|
||||
import androidx.compose.animation.core.animateFloatAsState
|
||||
import androidx.compose.animation.core.tween
|
||||
import androidx.compose.foundation.clickable
|
||||
import androidx.compose.foundation.layout.*
|
||||
import androidx.compose.material3.Icon
|
||||
|
|
@ -24,6 +25,7 @@ import com.tangem.core.ui.components.TextShimmer
|
|||
import com.tangem.core.ui.components.account.AccountCharIcon
|
||||
import com.tangem.core.ui.components.account.AccountIconSize
|
||||
import com.tangem.core.ui.components.account.AccountResIcon
|
||||
import com.tangem.core.ui.components.account.PaymentAccountIcon
|
||||
import com.tangem.core.ui.components.currency.icon.CurrencyIcon
|
||||
import com.tangem.core.ui.components.currency.icon.CurrencyIconState
|
||||
import com.tangem.core.ui.components.fields.SearchBar
|
||||
|
|
@ -98,6 +100,9 @@ fun PortfolioListItem(state: TokensListItemUM.Portfolio, isBalanceHidden: Boolea
|
|||
icon.copy(
|
||||
size = if (isExpanded) AccountIconSize.ExtraSmall else AccountIconSize.Default,
|
||||
)
|
||||
is CurrencyIconState.PaymentAccount -> icon.copy(
|
||||
size = if (isExpanded) AccountIconSize.ExtraSmall else AccountIconSize.Default,
|
||||
)
|
||||
else -> icon
|
||||
}
|
||||
|
||||
|
|
@ -183,7 +188,7 @@ fun PortfolioTokensListItem(state: PortfolioTokensListItemUM, isBalanceHidden: B
|
|||
}
|
||||
}
|
||||
|
||||
@Suppress("LongMethod")
|
||||
@Suppress("LongMethod", "CyclomaticComplexMethod")
|
||||
@Composable
|
||||
fun ExpandedPortfolioHeader(
|
||||
state: TokenItemState,
|
||||
|
|
@ -209,6 +214,7 @@ fun ExpandedPortfolioHeader(
|
|||
composables.icon.invoke(Modifier)
|
||||
} else {
|
||||
when (val icon = state.iconState) {
|
||||
is CurrencyIconState.PaymentAccount -> PaymentAccountIcon(size = icon.size)
|
||||
is CurrencyIconState.CryptoPortfolio.Icon -> AccountResIcon(
|
||||
resId = icon.resId,
|
||||
color = icon.color,
|
||||
|
|
|
|||
|
|
@ -169,6 +169,7 @@ private fun BoxScope.CurrencyIconBackgroundLayer(state: CurrencyIconState, blurR
|
|||
blurRadius = blurRadius,
|
||||
)
|
||||
}
|
||||
is CurrencyIconState.PaymentAccount -> Unit
|
||||
CurrencyIconState.Loading -> Unit
|
||||
CurrencyIconState.Locked -> Unit
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue