Updated on 2026-08-14

This commit is contained in:
Tangem 2025-09-16 14:32:40 +04:00
parent 9b1bf5813f
commit ef39279cb9
12 changed files with 187 additions and 20 deletions

View file

@ -10,6 +10,7 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.layout.onSizeChanged
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.tooling.preview.PreviewParameter
@ -20,6 +21,7 @@ import com.tangem.core.ui.components.RectangleShimmer
import com.tangem.core.ui.extensions.stringResourceSafe
import com.tangem.core.ui.res.TangemTheme
import com.tangem.core.ui.res.TangemThemePreview
import com.tangem.core.ui.test.MarketPriceBlockTestTags
import com.tangem.utils.StringsSigns.DASH_SIGN
/**
@ -45,7 +47,8 @@ fun MarketPriceBlock(state: MarketPriceBlockState, modifier: Modifier = Modifier
.fillMaxWidth()
.heightIn(min = TangemTheme.dimens.size72)
.padding(all = TangemTheme.dimens.spacing12)
.onSizeChanged { rootWidth = it.width },
.onSizeChanged { rootWidth = it.width }
.testTag(MarketPriceBlockTestTags.BLOCK),
verticalArrangement = Arrangement.spacedBy(TangemTheme.dimens.spacing4),
horizontalAlignment = Alignment.Start,
) {
@ -64,6 +67,7 @@ private fun Title(currencyName: String, modifier: Modifier = Modifier) {
text = stringResourceSafe(id = R.string.wallet_marketplace_block_title, currencyName),
color = TangemTheme.colors.text.tertiary,
style = TangemTheme.typography.subtitle2,
modifier = Modifier.testTag(MarketPriceBlockTestTags.TEXT),
)
}
}

View file

@ -9,12 +9,14 @@ import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.tooling.preview.Preview
import com.tangem.core.ui.R
import com.tangem.core.ui.extensions.stringResourceSafe
import com.tangem.core.ui.res.TangemTheme
import com.tangem.core.ui.res.TangemThemePreview
import com.tangem.core.ui.test.TransactionHistoryBlockTestTags
/**
* Transactions block title
@ -38,10 +40,13 @@ fun TxHistoryTitle(onExploreClick: () -> Unit, modifier: Modifier = Modifier) {
text = stringResourceSafe(id = R.string.common_transactions),
color = TangemTheme.colors.text.tertiary,
style = TangemTheme.typography.subtitle2,
modifier = Modifier.testTag(TransactionHistoryBlockTestTags.TITLE_TEXT),
)
Row(
modifier = Modifier.clickable(onClick = onExploreClick),
modifier = Modifier
.clickable(onClick = onExploreClick)
.testTag(TransactionHistoryBlockTestTags.EXPLORER_ICON),
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.spacedBy(space = TangemTheme.dimens.spacing2),
) {
@ -55,6 +60,7 @@ fun TxHistoryTitle(onExploreClick: () -> Unit, modifier: Modifier = Modifier) {
text = stringResourceSafe(id = R.string.common_explorer),
color = TangemTheme.colors.text.tertiary,
style = TangemTheme.typography.subtitle2,
modifier = Modifier.testTag(TransactionHistoryBlockTestTags.EXPLORER_TEXT),
)
}
}

View file

@ -8,6 +8,8 @@ object MainScreenTestTags {
const val WALLET_LIST_ITEM = "MAIN_SCREEN_WALLET_LIST_ITEM"
const val ORGANIZE_TOKENS_BUTTON = "MAIN_SCREEN_ORGANIZE_TOKENS_BUTTON"
const val MULTI_CURRENCY_ACTION_BUTTON = "MAIN_SCREEN_MULTI_CURRENCY_ACTION_BUTTON"
const val CARD_TITLE = "MAIN_SCREEN_CARD_TITLE"
const val CARD_IMAGE = "MAIN_SCREEN_CARD_IMAGE"
const val WALLET_BALANCE = "MAIN_SCREEN_WALLET_BALANCE"
const val TOTAL_BALANCE_MENU_ITEM = "MAIN_SCREEN_TOTAL_BALANCE_MENU_ITEM"

View file

@ -0,0 +1,6 @@
package com.tangem.core.ui.test
object MarketPriceBlockTestTags {
const val BLOCK = "MAIN_SCREEN_MARKET_PRICE_BLOCK"
const val TEXT = "MAIN_SCREEN_MARKET_PRICE_TEXT"
}

View file

@ -0,0 +1,7 @@
package com.tangem.core.ui.test
object TransactionHistoryBlockTestTags {
const val TITLE_TEXT = "TRANSACTION_HISTORY_TITLE_TEXT"
const val EXPLORER_TEXT = "TRANSACTION_HISTORY_EXPLORER_TEXT"
const val EXPLORER_ICON = "TRANSACTION_HISTORY_EXPLORER_ICON"
}