11package com.flipcash.app.balance.internal.components
22
3+ import androidx.compose.animation.AnimatedContent
4+ import androidx.compose.animation.Crossfade
5+ import androidx.compose.animation.core.tween
6+ import androidx.compose.animation.fadeIn
7+ import androidx.compose.animation.fadeOut
8+ import androidx.compose.animation.slideInVertically
9+ import androidx.compose.animation.slideOutVertically
10+ import androidx.compose.animation.togetherWith
311import androidx.compose.foundation.layout.Box
412import androidx.compose.foundation.layout.Column
513import androidx.compose.foundation.layout.fillMaxWidth
@@ -33,25 +41,28 @@ internal fun BalanceHeader(
3341 CodeCircularProgressIndicator ()
3442 }
3543 } else {
36- val isUsd = balance.converted.currencyCode.takeIf {
37- it == CurrencyCode .USD
38- } != null
39- AmountArea (
40- amountText = balance.converted.formatted(
41- suffix = balance.converted.currencyCode.takeIf {
42- it != CurrencyCode .USD
43- }?.let {
44- stringResource(R .string.subtitle_ofUsdSuffix)
45- }
46- ),
47- isAltCaption = false ,
48- isAltCaptionKinIcon = false ,
49- captionText = stringResource(R .string.subtitle_balanceIsHeldInUsd).takeIf { ! isUsd },
50- currencyResId = exchange.getFlagByCurrency(balance.converted.currencyCode.name),
51- isClickable = true ,
52- textStyle = CodeTheme .typography.displayLarge,
53- onClick = onClick
54- )
44+ Crossfade (balance.converted) { amount ->
45+ val isUsd = amount.currencyCode.takeIf {
46+ it == CurrencyCode .USD
47+ } != null
48+
49+ AmountArea (
50+ amountText = amount.formatted(
51+ suffix = amount.currencyCode.takeIf {
52+ it != CurrencyCode .USD
53+ }?.let {
54+ stringResource(R .string.subtitle_ofUsdSuffix)
55+ }
56+ ),
57+ isAltCaption = false ,
58+ isAltCaptionKinIcon = false ,
59+ captionText = stringResource(R .string.subtitle_balanceIsHeldInUsd).takeIf { ! isUsd },
60+ currencyResId = exchange.getFlagByCurrency(amount.currencyCode.name),
61+ isClickable = true ,
62+ textStyle = CodeTheme .typography.displayLarge,
63+ onClick = onClick
64+ )
65+ }
5566 }
5667 }
5768}
0 commit comments