diff --git a/core/res/src/main/res/values-ru/strings.xml b/core/res/src/main/res/values-ru/strings.xml index b4bd309592..5d25d41f8e 100644 --- a/core/res/src/main/res/values-ru/strings.xml +++ b/core/res/src/main/res/values-ru/strings.xml @@ -427,7 +427,7 @@ Уже содержится в введенном адресе Вычесть Недостаточно средств для покрытия комиссии сети. Вычесть недостающую сумму для покрытия комиссии из отправляемой суммы? - Сумма комиссии в %@ раз превышает рекомендованную. Убедитесь, что указанная комиссия верна. + Сумма комиссии в %s раз превышает рекомендованную. Убедитесь, что указанная комиссия верна. Вы указали комиссию ниже рекомендуемой, это может привести к задержке исполнения вашей транзакции. Продолжить? Причина: %1$s\nКод: %2$s Транзакция не выполнена @@ -537,9 +537,9 @@ Балансы скрыты Балансы показаны Отменить + Выбранная операция в данный момент недоступна. Попробуйте позже. В данный момент покупка монеты %s недоступна. Но мы работаем над её добавлением. У вас нет средств для отправки. Пополните счет, чтобы иметь возможность отправить с него средства. - Выбранная операция в данный момент недоступна. Попробуйте позже. Обмен %s не доступен. Но мы работаем над его добавлением. В данный момент продажа монеты %s недоступна. Но мы работаем над её добавлением. Сгенерировать XPUB @@ -548,6 +548,7 @@ Скрыть %s Скрыть токен %1$s токен в сети %%image%% %2$s + Токен в сети %%image%% %1$s Токен %1$s является основной валютой в сети %2$s и не может быть скрыт до тех пор, пока у вас в списке есть другие токены этой сети. Невозможно скрыть %s Обменивайте этот токен на другие с %1$s комиссии за обслуживание с %2$s по %3$s февраля. diff --git a/core/res/src/main/res/values/strings.xml b/core/res/src/main/res/values/strings.xml index 9310a0153a..a099c577d4 100644 --- a/core/res/src/main/res/values/strings.xml +++ b/core/res/src/main/res/values/strings.xml @@ -534,9 +534,9 @@ Balances hidden Balances shown Undo + This operation is currently unavailable. Please try again later. The purchase of the %s is currently unavailable. But we are working on adding it. You do not have funds to send. Top up your account to be able to send funds from it. - This operation is currently unavailable. Please try again later. %s swap is not available. But we are working on adding it. Sell of the %s coin is currently unavailable. But we are working on adding it. Generate XPUB @@ -545,6 +545,7 @@ Hide %s Hide token %1$s token in %%image%% %2$s network + Token in %%image%% %1$s network The %1$s token is the main currency on the %2$s network and cannot be hidden as long as you have other tokens on this network in the list. Unable to hide %s Exchange this token for another at %1$s service fees from February %2$s-%3$s. diff --git a/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/TokenDetailsPreviewData.kt b/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/TokenDetailsPreviewData.kt index 77f27a4cac..69d878168f 100644 --- a/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/TokenDetailsPreviewData.kt +++ b/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/TokenDetailsPreviewData.kt @@ -57,6 +57,21 @@ internal object TokenDetailsPreviewData { ), ) + val tokenInfoBlockStateWithLongNameNoStandard = TokenInfoBlockState( + name = "Tether (USDT) with long name test", + iconState = TokenInfoBlockState.IconState.TokenIcon( + url = "https://s3.eu-central-1.amazonaws.com/tangem.api/coins/large/stellar.png", + fallbackTint = Color.Cyan, + fallbackBackground = Color.Blue, + isGrayscale = false, + ), + currency = TokenInfoBlockState.Currency.Token( + standardName = null, + networkIcon = R.drawable.img_shibarium_22, + networkName = "Shibarium", + ), + ) + val tokenInfoBlockState = TokenInfoBlockState( name = "Tether USDT", iconState = TokenInfoBlockState.IconState.CustomTokenIcon( diff --git a/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/state/TokenInfoBlockState.kt b/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/state/TokenInfoBlockState.kt index 7c1e1eda2b..f0ec9e8d43 100644 --- a/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/state/TokenInfoBlockState.kt +++ b/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/state/TokenInfoBlockState.kt @@ -19,7 +19,7 @@ internal data class TokenInfoBlockState( * @param networkIcon - token's network icon. */ data class Token( - val standardName: String, + val standardName: String?, val networkName: String, @DrawableRes val networkIcon: Int, ) : Currency() diff --git a/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/state/factory/TokenDetailsSkeletonStateConverter.kt b/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/state/factory/TokenDetailsSkeletonStateConverter.kt index dbc7ff632b..163a1516ae 100644 --- a/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/state/factory/TokenDetailsSkeletonStateConverter.kt +++ b/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/state/factory/TokenDetailsSkeletonStateConverter.kt @@ -8,6 +8,7 @@ import com.tangem.core.ui.extensions.networkIconResId import com.tangem.core.ui.extensions.resourceReference import com.tangem.core.ui.res.TangemTheme import com.tangem.domain.tokens.model.CryptoCurrency +import com.tangem.domain.tokens.model.Network import com.tangem.feature.tokendetails.presentation.tokendetails.state.* import com.tangem.feature.tokendetails.presentation.tokendetails.state.components.TokenDetailsActionButton import com.tangem.feature.tokendetails.presentation.tokendetails.state.components.TokenDetailsPullToRefreshConfig @@ -40,7 +41,7 @@ internal class TokenDetailsSkeletonStateConverter( currency = when (value) { is CryptoCurrency.Coin -> TokenInfoBlockState.Currency.Native is CryptoCurrency.Token -> TokenInfoBlockState.Currency.Token( - standardName = value.network.standardType.name, + standardName = value.network.standardType.getSpecifiedNameOrNull(), networkName = value.network.name, networkIcon = value.networkIconResId, ) @@ -65,6 +66,9 @@ internal class TokenDetailsSkeletonStateConverter( ) } + private fun Network.StandardType.getSpecifiedNameOrNull(): String? = + name.takeIf { this !is Network.StandardType.Unspecified } + private fun createMenu(cryptoCurrency: CryptoCurrency): TokenDetailsAppBarMenuConfig = TokenDetailsAppBarMenuConfig( items = buildList { if (featureToggles.isGenerateXPubEnabled() && isBitcoin(cryptoCurrency.network.id.value)) { diff --git a/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/ui/components/TokenInfoBlock.kt b/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/ui/components/TokenInfoBlock.kt index 3254286ed2..3982a8dc21 100644 --- a/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/ui/components/TokenInfoBlock.kt +++ b/features/tokendetails/impl/src/main/kotlin/com/tangem/feature/tokendetails/presentation/tokendetails/ui/components/TokenInfoBlock.kt @@ -105,13 +105,22 @@ private const val SEPARATOR = " %image% " @Composable private fun extractNetwork(tokenCurrency: TokenInfoBlockState.Currency.Token): ExtractedTokenNetworkText { - val splitString = stringResource( - id = R.string.token_details_token_type_subtitle, - formatArgs = arrayOf( - tokenCurrency.standardName, - tokenCurrency.networkName, - ), - ).split(SEPARATOR) + val splitString = if (tokenCurrency.standardName != null) { + stringResource( + id = R.string.token_details_token_type_subtitle, + formatArgs = arrayOf( + tokenCurrency.standardName, + tokenCurrency.networkName, + ), + ).split(SEPARATOR) + } else { + stringResource( + id = R.string.token_details_token_type_subtitle_no_standard, + formatArgs = arrayOf( + tokenCurrency.networkName, + ), + ).split(SEPARATOR) + } return remember(splitString) { ExtractedTokenNetworkText( @@ -153,5 +162,6 @@ private class TokenInfoStateProvider : CollectionPreviewParameterProvider