Updated on 2026-08-14
This commit is contained in:
parent
9950bde845
commit
bfc17662fa
6 changed files with 175 additions and 5 deletions
|
|
@ -374,6 +374,9 @@
|
|||
<string name="markets_sort_by_top_losers_title">下落率上位</string>
|
||||
<string name="markets_sort_by_trending_title">トレンド</string>
|
||||
<string name="markets_token_details_about_token_title">%sについて</string>
|
||||
<plurals name="markets_token_details_amount_exchanges">
|
||||
<item quantity="other">%1$s取引所</item>
|
||||
</plurals>
|
||||
<plurals name="markets_token_details_based_on_ratings">
|
||||
<item quantity="other">%d のレーティングに基づいて</item>
|
||||
</plurals>
|
||||
|
|
@ -384,6 +387,7 @@
|
|||
<string name="markets_token_details_circulating_supply">循環供給量</string>
|
||||
<string name="markets_token_details_circulating_supply_description">取引可能で市場に流通しているコインの総数</string>
|
||||
<string name="markets_token_details_circulating_supply_full">循環供給量</string>
|
||||
<string name="markets_token_details_empty_exchanges">取引所が見つかりません</string>
|
||||
<string name="markets_token_details_experienced_buyers">経験豊富な買い手</string>
|
||||
<string name="markets_token_details_experienced_buyers_description">少なくとも100の発信取引を持つネット・バイヤー</string>
|
||||
<string name="markets_token_details_experienced_buyers_full">経験豊富な買い手</string>
|
||||
|
|
|
|||
|
|
@ -382,6 +382,12 @@
|
|||
<string name="markets_sort_by_top_losers_title">Лидеры падения</string>
|
||||
<string name="markets_sort_by_trending_title">В тренде</string>
|
||||
<string name="markets_token_details_about_token_title">О %s</string>
|
||||
<plurals name="markets_token_details_amount_exchanges">
|
||||
<item quantity="one">%1$s биржа</item>
|
||||
<item quantity="few">%1$s биржи</item>
|
||||
<item quantity="many">%1$s бирж</item>
|
||||
<item quantity="other">%1$s бирж</item>
|
||||
</plurals>
|
||||
<plurals name="markets_token_details_based_on_ratings">
|
||||
<item quantity="one">На основе %d оценки</item>
|
||||
<item quantity="few">На основе %d оценок</item>
|
||||
|
|
@ -395,6 +401,7 @@
|
|||
<string name="markets_token_details_circulating_supply">Циркулир. предл.</string>
|
||||
<string name="markets_token_details_circulating_supply_description">Общее количество монет, доступных для торговли и находящихся в обращении на рынке</string>
|
||||
<string name="markets_token_details_circulating_supply_full">Циркулирующее предложение</string>
|
||||
<string name="markets_token_details_empty_exchanges">Биржи не найдены</string>
|
||||
<string name="markets_token_details_experienced_buyers">Опытные трейдеры</string>
|
||||
<string name="markets_token_details_experienced_buyers_description">Покупатели, у которых было как минимум 100 исходящих транзакций.</string>
|
||||
<string name="markets_token_details_experienced_buyers_full">Опытные трейдеры</string>
|
||||
|
|
@ -412,6 +419,7 @@
|
|||
<string name="markets_token_details_liquidity_description">Изменение объема ликвидности, доступной для токена в течение указанного периода времени.</string>
|
||||
<string name="markets_token_details_liquidity_full">Ликвидность</string>
|
||||
<string name="markets_token_details_liquidity_index">Индекс ликвидности</string>
|
||||
<string name="markets_token_details_listed_on">Листинг на</string>
|
||||
<string name="markets_token_details_low">Низкий</string>
|
||||
<string name="markets_token_details_market_capitalization">Рын. кап.</string>
|
||||
<string name="markets_token_details_market_capitalization_description">Общая рыночная стоимость криптовалюты, рассчитываемая путем умножения текущей цены монеты на общее количество монет в обращении.</string>
|
||||
|
|
|
|||
|
|
@ -378,6 +378,10 @@
|
|||
<string name="markets_sort_by_top_losers_title">Top Losers</string>
|
||||
<string name="markets_sort_by_trending_title">Trending</string>
|
||||
<string name="markets_token_details_about_token_title">About %s</string>
|
||||
<plurals name="markets_token_details_amount_exchanges">
|
||||
<item quantity="one">%1$s exchange</item>
|
||||
<item quantity="other">%1$s exchanges</item>
|
||||
</plurals>
|
||||
<plurals name="markets_token_details_based_on_ratings">
|
||||
<item quantity="one">Based on %d rating</item>
|
||||
<item quantity="other">Based on %d ratings</item>
|
||||
|
|
@ -389,6 +393,7 @@
|
|||
<string name="markets_token_details_circulating_supply">Circulating supply</string>
|
||||
<string name="markets_token_details_circulating_supply_description">The total number of coins that are available for trading and are circulating in the market</string>
|
||||
<string name="markets_token_details_circulating_supply_full">Circulating supply</string>
|
||||
<string name="markets_token_details_empty_exchanges">No exchanges found</string>
|
||||
<string name="markets_token_details_experienced_buyers">Experienced buyers</string>
|
||||
<string name="markets_token_details_experienced_buyers_description">Net buyers with the additional requirement of having at least 100 outgoing transactions</string>
|
||||
<string name="markets_token_details_experienced_buyers_full">Experienced buyers</string>
|
||||
|
|
@ -406,6 +411,7 @@
|
|||
<string name="markets_token_details_liquidity_description">The change in how much liquidity is available for the token during the specified timeframe</string>
|
||||
<string name="markets_token_details_liquidity_full">Liquidity</string>
|
||||
<string name="markets_token_details_liquidity_index">Liquidity index</string>
|
||||
<string name="markets_token_details_listed_on">Listed on</string>
|
||||
<string name="markets_token_details_low">Low</string>
|
||||
<string name="markets_token_details_market_capitalization">Market cap</string>
|
||||
<string name="markets_token_details_market_capitalization_description">The total market value of a cryptocurrency, calculated by multiplying the current price of the coin by the total number of coins in circulation</string>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,135 @@
|
|||
package com.tangem.features.markets.details.impl.ui.components
|
||||
|
||||
import android.content.res.Configuration
|
||||
import androidx.compose.foundation.clickable
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.*
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.res.painterResource
|
||||
import androidx.compose.ui.text.style.TextOverflow
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.compose.ui.tooling.preview.PreviewParameter
|
||||
import androidx.compose.ui.tooling.preview.datasource.CollectionPreviewParameterProvider
|
||||
import com.tangem.common.ui.R
|
||||
import com.tangem.core.ui.components.TextShimmer
|
||||
import com.tangem.core.ui.components.block.information.InformationBlock
|
||||
import com.tangem.core.ui.extensions.resolveReference
|
||||
import com.tangem.core.ui.res.TangemTheme
|
||||
import com.tangem.core.ui.res.TangemThemePreview
|
||||
import com.tangem.features.markets.details.impl.ui.state.ListedOnUM
|
||||
import kotlinx.coroutines.delay
|
||||
|
||||
/**
|
||||
* "Listed on" block
|
||||
*
|
||||
* @param state block state
|
||||
*
|
||||
[REDACTED_AUTHOR]
|
||||
*/
|
||||
@Composable
|
||||
internal fun ListedOnBlock(state: ListedOnUM) {
|
||||
Box {
|
||||
InformationBlock(
|
||||
title = {
|
||||
Text(
|
||||
text = state.title.resolveReference(),
|
||||
style = TangemTheme.typography.subtitle2,
|
||||
color = TangemTheme.colors.text.tertiary,
|
||||
maxLines = 1,
|
||||
overflow = TextOverflow.Ellipsis,
|
||||
)
|
||||
},
|
||||
modifier = Modifier.clickable(enabled = state is ListedOnUM.Content) {
|
||||
(state as? ListedOnUM.Content)?.onClick?.invoke()
|
||||
},
|
||||
) {
|
||||
Description(
|
||||
state = state,
|
||||
modifier = Modifier.padding(bottom = TangemTheme.dimens.spacing12),
|
||||
)
|
||||
}
|
||||
|
||||
if (state is ListedOnUM.Content) {
|
||||
Icon(
|
||||
painter = painterResource(id = R.drawable.ic_chevron_right_24),
|
||||
contentDescription = null,
|
||||
tint = TangemTheme.colors.icon.informative,
|
||||
modifier = Modifier
|
||||
.align(Alignment.CenterEnd)
|
||||
.padding(end = TangemTheme.dimens.spacing12),
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
internal fun ListedOnBlockPlaceholder(modifier: Modifier = Modifier) {
|
||||
InformationBlock(
|
||||
title = {
|
||||
TextShimmer(
|
||||
style = TangemTheme.typography.subtitle2,
|
||||
modifier = Modifier.fillMaxWidth(fraction = 0.5f),
|
||||
)
|
||||
},
|
||||
modifier = modifier,
|
||||
) {
|
||||
TextShimmer(
|
||||
style = TangemTheme.typography.body2,
|
||||
modifier = Modifier
|
||||
.fillMaxWidth(fraction = 0.3f)
|
||||
.padding(bottom = TangemTheme.dimens.spacing12),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun Description(state: ListedOnUM, modifier: Modifier = Modifier) {
|
||||
Text(
|
||||
text = state.description.resolveReference(),
|
||||
modifier = modifier,
|
||||
color = TangemTheme.colors.text.tertiary,
|
||||
overflow = TextOverflow.Ellipsis,
|
||||
maxLines = 1,
|
||||
style = TangemTheme.typography.body2,
|
||||
)
|
||||
}
|
||||
|
||||
@Preview(widthDp = 328, heightDp = 68)
|
||||
@Preview(name = "Dark Theme", widthDp = 328, heightDp = 68, uiMode = Configuration.UI_MODE_NIGHT_YES)
|
||||
@Composable
|
||||
private fun Preview_ListedOnBlock(@PreviewParameter(ListenOnUMProvider::class) state: ListedOnUM?) {
|
||||
TangemThemePreview {
|
||||
if (state == null) {
|
||||
ListedOnBlockPlaceholder()
|
||||
} else {
|
||||
ListedOnBlock(state = state)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Preview
|
||||
@Composable
|
||||
private fun Preview_ListedOnBlock_StateChanging() {
|
||||
var state by remember { mutableStateOf<ListedOnUM?>(value = null) }
|
||||
|
||||
Preview_ListedOnBlock(state = state)
|
||||
|
||||
LaunchedEffect(key1 = null) {
|
||||
delay(timeMillis = 3000)
|
||||
|
||||
state = ListedOnUM.Empty
|
||||
}
|
||||
}
|
||||
|
||||
private class ListenOnUMProvider : CollectionPreviewParameterProvider<ListedOnUM?>(
|
||||
collection = listOf(
|
||||
ListedOnUM.Empty,
|
||||
ListedOnUM.Content(onClick = {}, amount = 5),
|
||||
null,
|
||||
),
|
||||
)
|
||||
|
|
@ -115,6 +115,10 @@ internal fun LazyListScope.infoBlocksList(state: MarketsTokenDetailsUM.Informati
|
|||
}
|
||||
}
|
||||
|
||||
item(key = "listedOn") {
|
||||
ListedOnBlock(state = state.listedOn)
|
||||
}
|
||||
|
||||
if (state.links != null) {
|
||||
item("links") {
|
||||
LinksBlock(
|
||||
|
|
@ -143,6 +147,10 @@ private fun LazyListScope.loadingInfoBlocks() {
|
|||
PricePerformanceBlockPlaceholder(modifier = Modifier.blockPaddings())
|
||||
}
|
||||
|
||||
item(key = "listedOn-loading") {
|
||||
ListedOnBlockPlaceholder(modifier = Modifier.blockPaddings())
|
||||
}
|
||||
|
||||
item("links-loading") {
|
||||
LinksBlockPlaceholder(modifier = Modifier.blockPaddings())
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,10 @@
|
|||
package com.tangem.features.markets.details.impl.ui.state
|
||||
|
||||
import com.tangem.core.ui.extensions.TextReference
|
||||
import com.tangem.core.ui.extensions.stringReference
|
||||
import com.tangem.core.ui.extensions.pluralReference
|
||||
import com.tangem.core.ui.extensions.resourceReference
|
||||
import com.tangem.core.ui.extensions.wrappedList
|
||||
import com.tangem.features.markets.impl.R
|
||||
|
||||
/**
|
||||
* "Listed on" block UI model
|
||||
|
|
@ -10,13 +13,16 @@ import com.tangem.core.ui.extensions.stringReference
|
|||
*/
|
||||
internal sealed interface ListedOnUM {
|
||||
|
||||
/** Title */
|
||||
val title: TextReference
|
||||
get() = resourceReference(id = R.string.markets_token_details_listed_on)
|
||||
|
||||
/** Description */
|
||||
val description: TextReference
|
||||
|
||||
/** Empty state. No exchanges found */
|
||||
data object Empty : ListedOnUM {
|
||||
// TODO [REDACTED_JIRA]
|
||||
override val description: TextReference = stringReference(value = "No exchanges found")
|
||||
override val description = resourceReference(id = R.string.markets_token_details_empty_exchanges)
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -29,7 +35,10 @@ internal sealed interface ListedOnUM {
|
|||
val onClick: () -> Unit,
|
||||
private val amount: Int,
|
||||
) : ListedOnUM {
|
||||
// TODO [REDACTED_JIRA]
|
||||
override val description: TextReference = stringReference(value = "$amount exchanges")
|
||||
override val description: TextReference = pluralReference(
|
||||
id = R.plurals.markets_token_details_amount_exchanges,
|
||||
count = amount,
|
||||
formatArgs = wrappedList(amount),
|
||||
)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue