Updated on 2026-08-14

This commit is contained in:
Tangem 2023-01-24 15:35:17 +08:00
parent d159d4e55b
commit 8dbcfaff99
23 changed files with 2335 additions and 2318 deletions

View file

@ -14,6 +14,7 @@ import com.tangem.core.analytics.Analytics
import com.tangem.tap.common.GlobalLayoutStateHandler
import com.tangem.tap.common.KeyboardObserver
import com.tangem.tap.common.analytics.events.Shop
import com.tangem.tap.common.extensions.getQuantityString
import com.tangem.tap.common.extensions.show
import com.tangem.tap.common.redux.navigation.NavigationAction
import com.tangem.tap.common.shop.data.ProductType
@ -106,6 +107,8 @@ class ShopFragment : BaseStoreFragment(R.layout.fragment_shop), StoreSubscriber<
chipProduct2.setOnCheckedChangeListener { _, isChecked ->
if (isChecked) store.dispatch(ShopAction.SelectProduct(ProductType.WALLET_2_CARDS))
}
chipProduct1.text = chipProduct1.getQuantityString(R.plurals.card_label_card_count, quantity = 3)
chipProduct2.text = chipProduct2.getQuantityString(R.plurals.card_label_card_count, quantity = 2)
}
private fun setupPromoCodeEditText() = with(binding) {

View file

@ -1,24 +1,23 @@
package com.tangem.tap.features.wallet.models
sealed class WalletWarning(
val showingPosition: Int,
) {
sealed class WalletWarning(val showingPosition: Int) {
data class ExistentialDeposit(
val currencyName: String,
val edStringValueWithSymbol: String,
) : WalletWarning(1)
data class TransactionInProgress(val currencyName: String) : WalletWarning(showingPosition = 10)
data class BalanceNotEnoughForFee(val blockchainFullName: String) : WalletWarning(showingPosition = 30)
data class BalanceNotEnoughForFee(
val currencyName: String,
val blockchainFullName: String,
val blockchainSymbol: String,
) : WalletWarning(showingPosition = 30)
data class Rent(val walletRent: WalletRent) : WalletWarning(showingPosition = 40)
}
data class WalletWarningDescription(
val title: String,
val message: String,
)
data class WalletWarningDescription(val title: String, val message: String)
data class WalletRent(
val minRentValue: String,
val rentExemptValue: String,
)
data class WalletRent(val minRentValue: String, val rentExemptValue: String)

View file

@ -367,11 +367,18 @@ data class WalletData(
}
private fun assembleTokenWarnings(walletWarnings: MutableList<WalletWarning>) {
if (!currency.isToken()) return
with(currency) {
if (!isToken()) return
val blockchainFullName = currency.blockchain.fullName
if (blockchainAmountIsEmpty() && !tokenAmountIsEmpty()) {
walletWarnings.add(WalletWarning.BalanceNotEnoughForFee(blockchainFullName))
if (blockchainAmountIsEmpty() && !tokenAmountIsEmpty()) {
walletWarnings.add(
WalletWarning.BalanceNotEnoughForFee(
currencyName = currencyName,
blockchainFullName = blockchain.fullName,
blockchainSymbol = blockchain.currency
)
)
}
}
}

View file

@ -25,8 +25,11 @@ class WalletWarningConverter(
is WalletWarning.BalanceNotEnoughForFee -> {
context.getString(
R.string.token_details_send_blocked_fee_format,
message.currencyName,
message.blockchainFullName,
message.currencyName,
message.blockchainFullName,
message.blockchainSymbol,
)
}
is WalletWarning.TransactionInProgress -> {

View file

@ -145,7 +145,6 @@
android:layout_width="wrap_content"
android:layout_height="36dp"
android:checked="true"
android:text="@string/shop_3_cards"
app:chipMinTouchTargetSize="0dp" />
<com.google.android.material.chip.Chip
@ -154,10 +153,7 @@
android:layout_width="wrap_content"
android:layout_height="36dp"
android:checked="false"
android:text="@string/shop_2_cards"
app:chipMinTouchTargetSize="0dp" />
</com.google.android.material.chip.ChipGroup>
<View