Updated on 2026-08-14

This commit is contained in:
Tangem 2020-12-18 17:29:07 +03:00
parent b7eb6aa766
commit 555be3d3e4
4 changed files with 23 additions and 7 deletions

View file

@ -40,6 +40,7 @@ data class TokenData(
class BalanceWidget(
val fragment: Fragment,
val data: BalanceWidgetData,
val isTwinCard: Boolean,
) {
fun setup() {
@ -100,8 +101,13 @@ class BalanceWidget(
BalanceStatus.EmptyCard -> {
fragment.l_balance.hide()
fragment.l_balance_error.show()
fragment.tv_error_title.text = fragment.getText(R.string.wallet_error_empty_card)
fragment.tv_error_descriptions.text = fragment.getText(R.string.wallet_error_empty_card_subtitle)
if (isTwinCard) {
fragment.tv_error_title.text = fragment.getText(R.string.wallet_error_empty_twin_card)
fragment.tv_error_descriptions.text = fragment.getText(R.string.wallet_error_empty_twin_card_subtitle)
} else {
fragment.tv_error_title.text = fragment.getText(R.string.wallet_error_empty_card)
fragment.tv_error_descriptions.text = fragment.getText(R.string.wallet_error_empty_card_subtitle)
}
}
BalanceStatus.NoAccount -> {
fragment.l_balance.hide()

View file

@ -132,7 +132,7 @@ class WalletFragment : Fragment(R.layout.fragment_wallet), StoreSubscriber<Walle
handleDialogs(state.walletDialog)
l_balance.show()
BalanceWidget(this, state.currencyData).setup()
BalanceWidget(this, state.currencyData, state.twinCardsState != null).setup()
if (state.state == ProgressState.Done) {
srl_wallet.isRefreshing = false
@ -203,7 +203,13 @@ class WalletFragment : Fragment(R.layout.fragment_wallet), StoreSubscriber<Walle
val buttonTitle = when (state.mainButton) {
is WalletMainButton.SendButton -> R.string.wallet_button_send
is WalletMainButton.CreateWalletButton -> R.string.wallet_button_create_wallet
is WalletMainButton.CreateWalletButton -> {
if (state.twinCardsState == null) {
R.string.wallet_button_create_wallet
} else {
R.string.wallet_button_create_twin_wallet
}
}
}
btnConfirm.text = getString(buttonTitle)
btnConfirm.isEnabled = state.mainButton.enabled

View file

@ -25,7 +25,7 @@
<string name="wallet_button_scan">Scan</string>
<string name="wallet_button_send">Send</string>
<string name="wallet_button_create_wallet">Create twin wallet</string>
<string name="wallet_button_create_wallet">Create wallet</string>
<string name="wallet_title">Tangem Tap</string>
<string name="wallet_choice_wallet_option_title">Choice wallet option</string>
@ -37,8 +37,8 @@
<string name="wallet_error_no_account">Account is not created</string>
<string name="wallet_error_no_account_subtitle_format">Load %1$s+ %2$s to create account</string>
<string name="wallet_error_empty_card">Create twin wallet</string>
<string name="wallet_error_empty_card_subtitle"> Generate wallet keys on both cards to start using your Twins</string>
<string name="wallet_error_empty_card">Empty card</string>
<string name="wallet_error_empty_card_subtitle">Create wallet to start using Tangem card</string>
<string name="wallet_error_unsupported_blockchain">This card is not supported</string>
<string name="wallet_error_unsupported_blockchain_subtitle">Your Tangem card was made to work with a different application. Please see the name and instructions on your card, and install the correct app</string>

View file

@ -4,6 +4,10 @@
<string name="wallet_address_chip_compatibility" translatable="false">Compatibility</string>
<string name="wallet_address_chip_legacy" translatable="false">Legacy</string>
<string name="wallet_button_create_twin_wallet" translatable="false">Create twin wallet</string>
<string name="wallet_error_empty_twin_card" translatable="false">Create twin wallet</string>
<string name="wallet_error_empty_twin_card_subtitle" translatable="false"> Generate wallet keys on both cards to start using your Twins</string>
<string name="twins_onboarding_title" translatable="false">Tangem Twin</string>
<string name="twins_onboarding_subtitle" translatable="false">One wallet. Two cards.</string>
<string name="twins_onboarding_description_format" translatable="false">This one that you are holding in your hands