Updated on 2026-08-14
This commit is contained in:
parent
b2f12e90aa
commit
1bc38864da
6 changed files with 33 additions and 26 deletions
|
|
@ -2,10 +2,10 @@ package com.tangem.core.ui.components.marketprice
|
|||
|
||||
import androidx.compose.animation.AnimatedContent
|
||||
import androidx.compose.animation.ExperimentalAnimationApi
|
||||
import androidx.compose.foundation.Image
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.layout.*
|
||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.material.Icon
|
||||
import androidx.compose.material.Text
|
||||
import androidx.compose.runtime.*
|
||||
import androidx.compose.ui.Alignment
|
||||
|
|
@ -136,13 +136,17 @@ private fun PriceChangeInPercent(config: PriceChangeConfig) {
|
|||
verticalAlignment = Alignment.CenterVertically,
|
||||
horizontalArrangement = Arrangement.spacedBy(space = TangemTheme.dimens.spacing4),
|
||||
) {
|
||||
Image(
|
||||
Icon(
|
||||
painter = painterResource(
|
||||
id = when (type) {
|
||||
PriceChangeConfig.Type.UP -> R.drawable.img_arrow_up_8
|
||||
PriceChangeConfig.Type.DOWN -> R.drawable.img_arrow_down_8
|
||||
PriceChangeConfig.Type.UP -> R.drawable.ic_arrow_up_8
|
||||
PriceChangeConfig.Type.DOWN -> R.drawable.ic_arrow_down_8
|
||||
},
|
||||
),
|
||||
tint = when (type) {
|
||||
PriceChangeConfig.Type.UP -> TangemTheme.colors.icon.accent
|
||||
PriceChangeConfig.Type.DOWN -> TangemTheme.colors.icon.warning
|
||||
},
|
||||
contentDescription = null,
|
||||
)
|
||||
|
||||
|
|
|
|||
9
core/ui/src/main/res/drawable/ic_arrow_down_8.xml
Normal file
9
core/ui/src/main/res/drawable/ic_arrow_down_8.xml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="9dp"
|
||||
android:height="8dp"
|
||||
android:viewportWidth="9"
|
||||
android:viewportHeight="8">
|
||||
<path
|
||||
android:fillColor="#000"
|
||||
android:pathData="M4.6,6.9C4.8,7.2 5.2,7.2 5.4,6.9L8.9,1.7C9.1,1.3 8.9,0.9 8.5,0.9L1.4,0.9C1,0.9 0.8,1.4 1,1.7L4.6,6.9Z" />
|
||||
</vector>
|
||||
9
core/ui/src/main/res/drawable/ic_arrow_up_8.xml
Normal file
9
core/ui/src/main/res/drawable/ic_arrow_up_8.xml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="9dp"
|
||||
android:height="8dp"
|
||||
android:viewportWidth="9"
|
||||
android:viewportHeight="8">
|
||||
<path
|
||||
android:fillColor="#000"
|
||||
android:pathData="M4.6,1.1C4.8,0.8 5.2,0.8 5.4,1.1L8.9,6.3C9.1,6.7 8.9,7.1 8.5,7.1L1.4,7.1C1,7.1 0.8,6.7 1,6.3L4.6,1.1Z" />
|
||||
</vector>
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="9dp"
|
||||
android:height="8dp"
|
||||
android:viewportWidth="9"
|
||||
android:viewportHeight="8">
|
||||
<path
|
||||
android:pathData="M4.6114,6.8903C4.8128,7.1793 5.2419,7.175 5.4375,6.8821L8.9151,1.6731C9.1369,1.3409 8.8988,0.8955 8.4993,0.8955L1.3921,0.8955C0.9881,0.8955 0.7509,1.3499 0.9819,1.6814L4.6114,6.8903Z"
|
||||
android:fillColor="#FF3333"/>
|
||||
</vector>
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="9dp"
|
||||
android:height="8dp"
|
||||
android:viewportWidth="9"
|
||||
android:viewportHeight="8">
|
||||
<path
|
||||
android:pathData="M4.6114,1.1097C4.8128,0.8207 5.2419,0.825 5.4375,1.1179L8.9151,6.3269C9.1369,6.6591 8.8988,7.1045 8.4993,7.1045L1.3921,7.1045C0.9881,7.1045 0.7509,6.6501 0.9819,6.3186L4.6114,1.1097Z"
|
||||
android:fillColor="#1ACE80"/>
|
||||
</vector>
|
||||
|
|
@ -2,7 +2,6 @@ package com.tangem.feature.wallet.presentation.common.component.token
|
|||
|
||||
import androidx.compose.animation.AnimatedContent
|
||||
import androidx.compose.animation.ExperimentalAnimationApi
|
||||
import androidx.compose.foundation.Image
|
||||
import androidx.compose.foundation.layout.*
|
||||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.material3.Text
|
||||
|
|
@ -87,13 +86,17 @@ private fun PriceChangeIcon(type: PriceChangeConfig.Type, modifier: Modifier = M
|
|||
label = "Update the price change's arrow",
|
||||
modifier = modifier,
|
||||
) {
|
||||
Image(
|
||||
Icon(
|
||||
painter = painterResource(
|
||||
id = when (it) {
|
||||
PriceChangeConfig.Type.UP -> R.drawable.img_arrow_up_8
|
||||
PriceChangeConfig.Type.DOWN -> R.drawable.img_arrow_down_8
|
||||
PriceChangeConfig.Type.UP -> R.drawable.ic_arrow_up_8
|
||||
PriceChangeConfig.Type.DOWN -> R.drawable.ic_arrow_down_8
|
||||
},
|
||||
),
|
||||
tint = when (it) {
|
||||
PriceChangeConfig.Type.UP -> TangemTheme.colors.icon.accent
|
||||
PriceChangeConfig.Type.DOWN -> TangemTheme.colors.icon.warning
|
||||
},
|
||||
contentDescription = null,
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue