diff --git a/app/build.gradle b/app/build.gradle index 774dd1aef6..48f34abcb7 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -93,7 +93,7 @@ dependencies { implementation 'com.google.android.play:core-ktx:1.8.1' coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5' - implementation 'com.tangem:blockchain:develop-87' + implementation 'com.tangem:blockchain:develop-88' // implementation 'com.tangem:blockchain:0.0.1' implementation 'com.tangem.tangem-sdk-kotlin:core:develop-154' implementation 'com.tangem.tangem-sdk-kotlin:android:develop-154' diff --git a/app/src/main/java/com/tangem/tap/common/compose/extensions/LazyListState.kt b/app/src/main/java/com/tangem/tap/common/compose/extensions/LazyListState.kt index a14477efca..f05044368f 100644 --- a/app/src/main/java/com/tangem/tap/common/compose/extensions/LazyListState.kt +++ b/app/src/main/java/com/tangem/tap/common/compose/extensions/LazyListState.kt @@ -2,6 +2,8 @@ package com.tangem.tap.common.compose.extensions import androidx.compose.foundation.lazy.LazyListState import androidx.compose.runtime.* +import androidx.compose.ui.platform.LocalView +import com.tangem.tap.common.extensions.hideKeyboard @Composable fun LazyListState.OnBottomReached(loadMoreThreshold: Int, loadMore: () -> Unit) { @@ -17,4 +19,11 @@ fun LazyListState.OnBottomReached(loadMoreThreshold: Int, loadMore: () -> Unit) LaunchedEffect(shouldLoadMore) { if (shouldLoadMore) loadMore() } +} + +@Composable +fun LazyListState.HideKeyboardOnScroll() { + if (isScrollInProgress) { + LocalView.current.hideKeyboard() + } } \ No newline at end of file diff --git a/app/src/main/java/com/tangem/tap/common/extensions/UI.kt b/app/src/main/java/com/tangem/tap/common/extensions/UI.kt index 9cf8354a70..617f69c36d 100644 --- a/app/src/main/java/com/tangem/tap/common/extensions/UI.kt +++ b/app/src/main/java/com/tangem/tap/common/extensions/UI.kt @@ -194,7 +194,7 @@ fun Context.safeStartActivity( } fun View.getString(resId: Int, vararg formatArgs: Any?): String { - return context.getString(resId, formatArgs) + return context.getString(resId, *formatArgs) } fun View.animateVisibility( diff --git a/app/src/main/java/com/tangem/tap/domain/extensions/CurrencyExchangeManager.kt b/app/src/main/java/com/tangem/tap/domain/extensions/CurrencyExchangeManager.kt index d3f7730510..23be9f4aaf 100644 --- a/app/src/main/java/com/tangem/tap/domain/extensions/CurrencyExchangeManager.kt +++ b/app/src/main/java/com/tangem/tap/domain/extensions/CurrencyExchangeManager.kt @@ -1,6 +1,7 @@ package com.tangem.tap.domain.extensions import com.tangem.blockchain.common.Blockchain +import com.tangem.blockchain.common.Blockchain.Arbitrum import com.tangem.tap.features.wallet.redux.Currency import com.tangem.tap.network.exchangeServices.CurrencyExchangeManager import com.tangem.tap.network.exchangeServices.CurrencyExchangeStatus @@ -19,6 +20,7 @@ fun CurrencyExchangeManager.sellIsAllowed(currency: Currency): Boolean { fun CurrencyExchangeStatus.buyIsAllowed(currency: Currency): Boolean { if (store.state.globalState.configManager?.config?.isTopUpEnabled == false) return false + if (currency.blockchain == Arbitrum) return false if (!isBuyAllowed) return false //TODO: temporary, for the 3.32 release, unlock all buy button diff --git a/app/src/main/java/com/tangem/tap/features/details/redux/DetailsAction.kt b/app/src/main/java/com/tangem/tap/features/details/redux/DetailsAction.kt index 0739effc65..c37a625c54 100644 --- a/app/src/main/java/com/tangem/tap/features/details/redux/DetailsAction.kt +++ b/app/src/main/java/com/tangem/tap/features/details/redux/DetailsAction.kt @@ -5,6 +5,7 @@ import com.tangem.common.card.Card import com.tangem.domain.common.ScanResponse import com.tangem.domain.common.TwinCardNumber import com.tangem.operations.pins.CheckUserCodesResponse +import com.tangem.tap.common.entities.FiatCurrency import com.tangem.tap.common.redux.NotificationAction import com.tangem.tap.domain.termsOfUse.CardTou import com.tangem.wallet.R @@ -58,4 +59,5 @@ sealed class DetailsAction : Action { } } + data class ChangeAppCurrency(val fiatCurrency: FiatCurrency) : DetailsAction() } \ No newline at end of file diff --git a/app/src/main/java/com/tangem/tap/features/details/redux/DetailsReducer.kt b/app/src/main/java/com/tangem/tap/features/details/redux/DetailsReducer.kt index 45910f64c4..a095d46d7e 100644 --- a/app/src/main/java/com/tangem/tap/features/details/redux/DetailsReducer.kt +++ b/app/src/main/java/com/tangem/tap/features/details/redux/DetailsReducer.kt @@ -31,6 +31,9 @@ private fun internalReduce(action: Action, state: AppState): DetailsState { is DetailsAction.ManageSecurity -> { handleSecurityAction(action, detailsState) } + is DetailsAction.ChangeAppCurrency -> + detailsState.copy(appCurrency = action.fiatCurrency) + else -> detailsState } } diff --git a/app/src/main/java/com/tangem/tap/features/details/redux/DetailsState.kt b/app/src/main/java/com/tangem/tap/features/details/redux/DetailsState.kt index eca730c5e2..ee6fd2bb7e 100644 --- a/app/src/main/java/com/tangem/tap/features/details/redux/DetailsState.kt +++ b/app/src/main/java/com/tangem/tap/features/details/redux/DetailsState.kt @@ -4,6 +4,7 @@ import android.net.Uri import com.tangem.blockchain.common.Wallet import com.tangem.domain.common.ScanResponse import com.tangem.tap.common.entities.Button +import com.tangem.tap.common.entities.FiatCurrency import com.tangem.tap.features.onboarding.products.twins.redux.TwinCardsState import com.tangem.tap.store import org.rekotlin.StateType @@ -19,6 +20,7 @@ data class DetailsState( val securityScreenState: SecurityScreenState? = null, val cardTermsOfUseUrl: Uri? = null, val createBackupAllowed: Boolean = false, + val appCurrency: FiatCurrency = FiatCurrency.Default ) : StateType { // if you do not delegate - the application crashes on startup, diff --git a/app/src/main/java/com/tangem/tap/features/details/ui/DetailsFragment.kt b/app/src/main/java/com/tangem/tap/features/details/ui/DetailsFragment.kt index d4ad890b8b..e8f3b56a62 100644 --- a/app/src/main/java/com/tangem/tap/features/details/ui/DetailsFragment.kt +++ b/app/src/main/java/com/tangem/tap/features/details/ui/DetailsFragment.kt @@ -17,6 +17,7 @@ import com.tangem.tap.features.details.redux.DetailsAction import com.tangem.tap.features.details.redux.DetailsState import com.tangem.tap.features.details.redux.SecurityOption import com.tangem.tap.features.feedback.FeedbackEmail +import com.tangem.tap.features.wallet.redux.WalletAction import com.tangem.tap.store import com.tangem.wallet.R import com.tangem.wallet.databinding.FragmentDetailsBinding @@ -114,6 +115,14 @@ class DetailsFragment : Fragment(R.layout.fragment_details), StoreSubscriber.filterByCoin(): List { } fun List.filterByToken(token: Token): List { - return this.filter { it.currency == token.symbol } + return this.filter { it.transactionData.amount.currencySymbol == token.symbol } } fun TransactionData.toPendingTransactionForToken(token: Token, walletAddress: String): PendingTransaction? { diff --git a/app/src/main/java/com/tangem/tap/features/wallet/redux/WalletState.kt b/app/src/main/java/com/tangem/tap/features/wallet/redux/WalletState.kt index e8b093c5ab..b906784269 100644 --- a/app/src/main/java/com/tangem/tap/features/wallet/redux/WalletState.kt +++ b/app/src/main/java/com/tangem/tap/features/wallet/redux/WalletState.kt @@ -9,7 +9,6 @@ import com.tangem.blockchain.common.Wallet import com.tangem.blockchain.common.WalletManager import com.tangem.blockchain.common.address.AddressType import com.tangem.common.extensions.isZero -import com.tangem.domain.common.TapWorkarounds.derivationStyle import com.tangem.domain.common.extensions.canHandleToken import com.tangem.domain.common.extensions.toCoinId import com.tangem.domain.features.addCustomToken.CustomCurrency @@ -67,13 +66,14 @@ data class WalletState( val isTangemTwins: Boolean get() = store.state.globalState.scanResponse?.isTangemTwins() == true - val primaryWallet: WalletData? = if (wallets.isNotEmpty()) wallets[0].walletsData[0] else null + val primaryWallet: WalletData? = wallets.firstOrNull() + ?.walletsData?.firstOrNull() val primaryWalletManager: WalletManager? = if (wallets.isNotEmpty()) wallets[0].walletManager else null val shouldShowDetails: Boolean = primaryWallet?.currencyData?.status != BalanceStatus.EmptyCard && - primaryWallet?.currencyData?.status != BalanceStatus.UnknownBlockchain + primaryWallet?.currencyData?.status != BalanceStatus.UnknownBlockchain val blockchains: List get() = wallets.mapNotNull { it.walletManager?.wallet?.blockchain } @@ -232,6 +232,8 @@ data class WalletState( && it.blockchainNetwork.derivationPath == walletData.currency.derivationPath } copy(wallets = walletStores) + .updateTotalBalance() + .updateProgressState() } else { val walletStore = getWalletStore(walletData.currency) val walletDataList = walletStore?.walletsData @@ -284,24 +286,15 @@ data class WalletState( } private fun updateTotalBalance(): WalletState { - return if (this.wallets.isNotEmpty()) { - val globalState = store.state.globalState - val walletsData = this.wallets - .flatMap(WalletStore::walletsData) - .filterNot { wallet -> - wallet.currency.isCustomCurrency( - derivationStyle = globalState - .scanResponse - ?.card - ?.derivationStyle - ) - } + val walletsData = this.wallets + .flatMap(WalletStore::walletsData) + return if (walletsData.isNotEmpty()) { this.copy( totalBalance = TotalBalance( state = walletsData.findProgressState(), fiatAmount = walletsData.calculateTotalFiatAmount(), - fiatCurrency = globalState.appCurrency + fiatCurrency = store.state.globalState.appCurrency ) ) } else this.copy( @@ -310,9 +303,10 @@ data class WalletState( } private fun updateProgressState(): WalletState { - return if (this.wallets.isNotEmpty()) { - val walletsData = this.wallets - .flatMap(WalletStore::walletsData) + val walletsData = this.wallets + .flatMap(WalletStore::walletsData) + + return if (walletsData.isNotEmpty()) { val newProgressState = walletsData.findProgressState() this.copy( diff --git a/app/src/main/java/com/tangem/tap/features/wallet/redux/middlewares/AppCurrencyMiddleware.kt b/app/src/main/java/com/tangem/tap/features/wallet/redux/middlewares/AppCurrencyMiddleware.kt index 904aecab65..d339e49202 100644 --- a/app/src/main/java/com/tangem/tap/features/wallet/redux/middlewares/AppCurrencyMiddleware.kt +++ b/app/src/main/java/com/tangem/tap/features/wallet/redux/middlewares/AppCurrencyMiddleware.kt @@ -7,6 +7,7 @@ import com.tangem.tap.common.entities.FiatCurrency import com.tangem.tap.common.extensions.dispatchDialogShow import com.tangem.tap.common.redux.global.GlobalAction import com.tangem.tap.domain.TapWalletManager +import com.tangem.tap.features.details.redux.DetailsAction import com.tangem.tap.features.wallet.redux.WalletAction import com.tangem.tap.features.wallet.redux.WalletDialog import com.tangem.tap.persistence.FiatCurrenciesPrefStorage @@ -63,6 +64,7 @@ class AppCurrencyMiddleware( tapWalletManager.rates.clear() fiatCurrenciesPrefStorage.saveAppCurrency(action.fiatCurrency) store.dispatch(GlobalAction.ChangeAppCurrency(action.fiatCurrency)) + store.dispatch(DetailsAction.ChangeAppCurrency(action.fiatCurrency)) store.dispatch(WalletAction.LoadFiatRate()) } diff --git a/app/src/main/java/com/tangem/tap/features/wallet/redux/reducers/MultiWalletReducer.kt b/app/src/main/java/com/tangem/tap/features/wallet/redux/reducers/MultiWalletReducer.kt index 41f297af89..850f6b3b3b 100644 --- a/app/src/main/java/com/tangem/tap/features/wallet/redux/reducers/MultiWalletReducer.kt +++ b/app/src/main/java/com/tangem/tap/features/wallet/redux/reducers/MultiWalletReducer.kt @@ -2,7 +2,6 @@ package com.tangem.tap.features.wallet.redux.reducers import com.tangem.blockchain.common.AmountType import com.tangem.blockchain.common.Token -import com.tangem.blockchain.extensions.isAboveZero import com.tangem.common.extensions.guard import com.tangem.tap.common.extensions.toFiatString import com.tangem.tap.common.extensions.toFormattedCurrencyString @@ -11,12 +10,7 @@ import com.tangem.tap.domain.tokens.models.BlockchainNetwork import com.tangem.tap.features.wallet.models.filterByToken import com.tangem.tap.features.wallet.models.getPendingTransactions import com.tangem.tap.features.wallet.models.removeUnknownTransactions -import com.tangem.tap.features.wallet.redux.Currency -import com.tangem.tap.features.wallet.redux.WalletAction -import com.tangem.tap.features.wallet.redux.WalletData -import com.tangem.tap.features.wallet.redux.WalletMainButton -import com.tangem.tap.features.wallet.redux.WalletState -import com.tangem.tap.features.wallet.redux.WalletStore +import com.tangem.tap.features.wallet.redux.* import com.tangem.tap.features.wallet.ui.BalanceStatus import com.tangem.tap.features.wallet.ui.BalanceWidgetData import com.tangem.tap.features.wallet.ui.TokenData @@ -120,7 +114,8 @@ class MultiWalletReducer { else -> BalanceStatus.VerifiedOnline } val tokenWalletData = state.getWalletData(currency) - val isTokenSendButtonEnabled = action.amount.isAboveZero() && pendingTransactions.isEmpty() + val isTokenSendButtonEnabled = tokenWalletData?.shouldEnableTokenSendButton() == true + && pendingTransactions.isEmpty() val newTokenWalletData = tokenWalletData?.copy( currencyData = tokenWalletData.currencyData.copy( diff --git a/app/src/main/java/com/tangem/tap/features/wallet/redux/reducers/OnWalletLoadedReducer.kt b/app/src/main/java/com/tangem/tap/features/wallet/redux/reducers/OnWalletLoadedReducer.kt index ffbe3cce5d..ac3ede0818 100644 --- a/app/src/main/java/com/tangem/tap/features/wallet/redux/reducers/OnWalletLoadedReducer.kt +++ b/app/src/main/java/com/tangem/tap/features/wallet/redux/reducers/OnWalletLoadedReducer.kt @@ -12,11 +12,7 @@ import com.tangem.tap.domain.tokens.models.BlockchainNetwork import com.tangem.tap.features.wallet.models.filterByToken import com.tangem.tap.features.wallet.models.getPendingTransactions import com.tangem.tap.features.wallet.models.removeUnknownTransactions -import com.tangem.tap.features.wallet.redux.Currency -import com.tangem.tap.features.wallet.redux.ProgressState -import com.tangem.tap.features.wallet.redux.TradeCryptoState -import com.tangem.tap.features.wallet.redux.WalletMainButton -import com.tangem.tap.features.wallet.redux.WalletState +import com.tangem.tap.features.wallet.redux.* import com.tangem.tap.features.wallet.ui.BalanceStatus import com.tangem.tap.features.wallet.ui.BalanceWidgetData import com.tangem.tap.features.wallet.ui.TokenData @@ -89,7 +85,7 @@ class OnWalletLoadedReducer { tokenWalletData?.fiatRate?.let { rate -> tokenAmountValue?.toFiatValue(rate) } val isTokenSendButtonEnabled = newWalletData.shouldEnableTokenSendButton() - && tokenPendingTransactions.isEmpty() + && pendingTransactions.isEmpty() tokenWalletData?.copy( currencyData = tokenWalletData.currencyData.copy( status = tokenBalanceStatus, diff --git a/app/src/main/java/com/tangem/tap/features/wallet/redux/reducers/TotalBalanceOperations.kt b/app/src/main/java/com/tangem/tap/features/wallet/redux/reducers/TotalBalanceOperations.kt index c0ead34d52..15e44ea361 100644 --- a/app/src/main/java/com/tangem/tap/features/wallet/redux/reducers/TotalBalanceOperations.kt +++ b/app/src/main/java/com/tangem/tap/features/wallet/redux/reducers/TotalBalanceOperations.kt @@ -18,8 +18,9 @@ fun List.calculateTotalFiatAmount(): BigDecimal { } private fun List.mapToProgressState(): List { - return this.map { - when (it.currencyData.status) { + return this.map { wallet -> + if (wallet.fiatRate == null) ProgressState.Error + else when (wallet.currencyData.status) { BalanceStatus.Refreshing -> ProgressState.Refreshing BalanceStatus.VerifiedOnline, BalanceStatus.SameCurrencyTransactionInProgress, diff --git a/app/src/main/java/com/tangem/tap/features/wallet/redux/reducers/WalletReducer.kt b/app/src/main/java/com/tangem/tap/features/wallet/redux/reducers/WalletReducer.kt index 426fb74e2b..fe7213d361 100644 --- a/app/src/main/java/com/tangem/tap/features/wallet/redux/reducers/WalletReducer.kt +++ b/app/src/main/java/com/tangem/tap/features/wallet/redux/reducers/WalletReducer.kt @@ -9,6 +9,7 @@ import com.tangem.tap.common.entities.FiatCurrency import com.tangem.tap.common.extensions.toFiatRateString import com.tangem.tap.common.extensions.toFiatString import com.tangem.tap.common.extensions.toFiatValue +import com.tangem.tap.common.extensions.toFormattedCurrencyString import com.tangem.tap.common.extensions.toFormattedFiatValue import com.tangem.tap.common.redux.AppState import com.tangem.tap.domain.TapError @@ -201,31 +202,37 @@ private fun internalReduce(action: Action, state: AppState): WalletState { walletState = newState ) is WalletAction.LoadWallet.NoAccount -> { - val walletData = newState.getWalletData(action.blockchain)?.copy( - currencyData = BalanceWidgetData( - BalanceStatus.NoAccount, action.wallet.blockchain.fullName, - currencySymbol = action.wallet.blockchain.currency, - amountToCreateAccount = action.amountToCreateAccount + val amount = BigDecimal.ZERO + val fiatAmount = BigDecimal.ZERO + val walletData = newState.getWalletData(action.blockchain)?.let { walletData -> + val walletBlockchain = walletData.currency.blockchain + walletData.copy( + currencyData = BalanceWidgetData( + status = BalanceStatus.NoAccount, + currency = action.wallet.blockchain.fullName, + currencySymbol = action.wallet.blockchain.currency, + amount = amount, + amountFormatted = amount.toFormattedCurrencyString( + decimals = walletBlockchain.decimals(), + currency = walletBlockchain.currency, + ), + fiatAmount = fiatAmount, + fiatAmountFormatted = fiatAmount.toFiatRateString( + fiatCurrencyName = store.state.globalState.appCurrency.symbol + ), + amountToCreateAccount = action.amountToCreateAccount, + ) ) - ) + } var updatedWalletStore = newState.getWalletStore(action.blockchain) ?.updateWallets(listOfNotNull(walletData)) - val progressState = - if (updatedWalletStore?.walletsData?.any { it.currencyData.status == BalanceStatus.Loading } == true) { - ProgressState.Loading - } else { - ProgressState.Done - } updatedWalletStore = updatedWalletStore?.updateWallets( newState.updateTradeCryptoState(exchangeManager, updatedWalletStore.walletsData) ) newState = newState.updateWalletStore(updatedWalletStore) - .copy( - state = progressState - ) } is WalletAction.LoadWallet.Failure -> { @@ -420,19 +427,24 @@ private fun setMultiWalletFiatRate( state: WalletState ): WalletState { val newWalletsData = fiatRates.mapNotNull { (currency, rate) -> - val walletStore = state.getWalletStore(currency) ?: return state + val walletStore = state.getWalletStore(currency) ?: return@mapNotNull null val wallet = walletStore.walletManager?.wallet - val walletData = state.getWalletData(currency) ?: return state + val walletData = state.getWalletData(currency) ?: return@mapNotNull null + val currencyData = walletData.currencyData - val fiatAmount = when (currency) { + var fiatAmount = when (currency) { is Currency.Blockchain -> wallet?.amounts?.get(AmountType.Coin)?.value?.toFiatValue(rate) is Currency.Token -> wallet?.getTokenAmount(currency.token)?.value?.toFiatValue(rate) } + if (currencyData.status == BalanceStatus.NoAccount && fiatAmount == null) { + fiatAmount = BigDecimal.ZERO + } val fiatAmountFormatted = fiatAmount?.toFormattedFiatValue(appCurrency.symbol) - state.getWalletData(currency)?.copy( - currencyData = walletData.currencyData.copy( + + walletData.copy( + currencyData = currencyData.copy( fiatAmountFormatted = fiatAmountFormatted, fiatAmount = fiatAmount ), diff --git a/app/src/main/java/com/tangem/tap/features/wallet/ui/adapters/WalletAdapter.kt b/app/src/main/java/com/tangem/tap/features/wallet/ui/adapters/WalletAdapter.kt index b7604317f3..afcb72f78e 100644 --- a/app/src/main/java/com/tangem/tap/features/wallet/ui/adapters/WalletAdapter.kt +++ b/app/src/main/java/com/tangem/tap/features/wallet/ui/adapters/WalletAdapter.kt @@ -113,11 +113,8 @@ class WalletAdapter lContent.tvStatus.text = statusMessage lContent.tvExchangeRate.isVisible = statusMessage == null - lContent.tvExchangeRate.text = if (isCustomCurrency) { - root.getString(id = R.string.token_item_no_rate) - } else { - wallet.fiatRateString ?: "—" - } + lContent.tvExchangeRate.text = wallet.fiatRateString + ?: root.getString(id = R.string.token_item_no_rate) badgeCustomBalance.isVisible = isCustomCurrency diff --git a/app/src/main/java/com/tangem/tap/features/wallet/ui/wallet/MultiWalletView.kt b/app/src/main/java/com/tangem/tap/features/wallet/ui/wallet/MultiWalletView.kt index e228e737bd..5646b437f0 100644 --- a/app/src/main/java/com/tangem/tap/features/wallet/ui/wallet/MultiWalletView.kt +++ b/app/src/main/java/com/tangem/tap/features/wallet/ui/wallet/MultiWalletView.kt @@ -138,8 +138,7 @@ class MultiWalletView : WalletView { show = totalBalance.state == ProgressState.Error ) - tvBalance.text = if (totalBalance.state == ProgressState.Error) "—" - else totalBalance.fiatAmount.formatAmountAsSpannedString( + tvBalance.text = totalBalance.fiatAmount.formatAmountAsSpannedString( currencySymbol = totalBalance.fiatCurrency.symbol ) tvCurrencyName.text = totalBalance.fiatCurrency.code @@ -193,7 +192,6 @@ class MultiWalletView : WalletView { private fun configureButtonsForEmptyWalletState(binding: FragmentWalletBinding) = with(binding) { lButtonsLong.root.show() - lButtonsLong.btnScanLong.setOnClickListener { store.dispatch(WalletAction.Scan) } lButtonsLong.btnConfirmLong.setOnClickListener { store.dispatch(WalletAction.CreateWallet) } lButtonsLong.btnConfirmLong.text = fragment?.getText(R.string.wallet_button_create_wallet) diff --git a/app/src/main/java/com/tangem/tap/features/wallet/ui/wallet/SingleWalletView.kt b/app/src/main/java/com/tangem/tap/features/wallet/ui/wallet/SingleWalletView.kt index 4fb9b0ca0b..b7e0a307a5 100644 --- a/app/src/main/java/com/tangem/tap/features/wallet/ui/wallet/SingleWalletView.kt +++ b/app/src/main/java/com/tangem/tap/features/wallet/ui/wallet/SingleWalletView.kt @@ -130,20 +130,8 @@ class SingleWalletView : WalletView { lButtonsLong.btnConfirmLong } - val btnScan = if (state.tradeCryptoState.sellingAllowed || - state.tradeCryptoState.buyingAllowed - ) { - lButtonsShort.btnScan - } else { - lButtonsLong.btnScanLong - } - setupConfirmButton(state, btnConfirm, isTwinsWallet) - btnScan.setOnClickListener { - store.dispatch(WalletAction.Scan) - } - lAddress.btnCopy.setOnClickListener { state.walletAddresses?.selectedAddress?.address?.let { addressString -> store.dispatch(WalletAction.CopyAddress(addressString, fragment!!.requireContext())) diff --git a/app/src/main/res/layout/card_total_balance.xml b/app/src/main/res/layout/card_total_balance.xml index 196dc167e1..1f97649e18 100644 --- a/app/src/main/res/layout/card_total_balance.xml +++ b/app/src/main/res/layout/card_total_balance.xml @@ -52,7 +52,7 @@ app:veilLayout_veiled="true" app:veilLayout_radius="4dp" app:layout_constraintTop_toBottomOf="@id/tv_title" - app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintBottom_toTopOf="@id/tv_processing" app:layout_constraintStart_toStartOf="parent" app:layout_constraintEnd_toEndOf="parent" tools:veilLayout_veiled="false"> @@ -80,7 +80,8 @@ android:textSize="12sp" android:text="@string/main_processing_full_amount" app:layout_constraintTop_toBottomOf="@id/veil_balance" - app:layout_constraintStart_toStartOf="parent" /> + app:layout_constraintStart_toStartOf="parent" + tools:visibility="visible" /> + + + + + + android:layout_height="wrap_content" + android:drawablePadding="15dp" + android:paddingTop="7dp" + android:paddingBottom="7dp" + android:text="@string/disclaimer_title" + android:textColor="@color/darkGray6" + android:textSize="16sp" + app:drawableEndCompat="@drawable/ic_angle_bracket_right" + app:drawableTint="@color/darkGray1" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintTop_toBottomOf="@id/tv_app_currency_title" /> - + \ No newline at end of file diff --git a/app/src/main/res/layout/layout_wallet_long_buttons.xml b/app/src/main/res/layout/layout_wallet_long_buttons.xml index fa2a403d60..f670b7fd5d 100644 --- a/app/src/main/res/layout/layout_wallet_long_buttons.xml +++ b/app/src/main/res/layout/layout_wallet_long_buttons.xml @@ -4,22 +4,6 @@ android:layout_width="match_parent" android:layout_height="match_parent"> - - - \ No newline at end of file + diff --git a/app/src/main/res/layout/layout_wallet_short_buttons.xml b/app/src/main/res/layout/layout_wallet_short_buttons.xml index 08bdfeef5a..ed60601395 100644 --- a/app/src/main/res/layout/layout_wallet_short_buttons.xml +++ b/app/src/main/res/layout/layout_wallet_short_buttons.xml @@ -14,8 +14,8 @@ android:layout_marginBottom="8dp" android:text="@string/wallet_button_trade" app:icon="@drawable/ic_arrows_up_down" - app:layout_constraintBottom_toTopOf="@id/btn_scan" - app:layout_constraintEnd_toStartOf="@id/btn_confirm" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toStartOf="@id/btn_confirm" app:layout_constraintHorizontal_bias="0.5" app:layout_constraintHorizontal_chainStyle="packed" app:layout_constraintStart_toStartOf="parent" @@ -34,29 +34,10 @@ android:text="@string/wallet_button_send" app:icon="@drawable/ic_send" app:iconGravity="textEnd" - android:textAlignment="center" - app:layout_constraintBottom_toTopOf="@id/btn_scan" - app:layout_constraintEnd_toEndOf="parent" + android:textAlignment="center" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintEnd_toEndOf="parent" app:layout_constraintStart_toEndOf="@id/btn_trade" app:layout_constraintVertical_bias="1" /> - - - - - \ No newline at end of file + diff --git a/app/src/main/res/values-ru/strings_final.xml b/app/src/main/res/values-ru/strings_final.xml index ea424b57b6..201a1684ae 100644 --- a/app/src/main/res/values-ru/strings_final.xml +++ b/app/src/main/res/values-ru/strings_final.xml @@ -47,7 +47,7 @@ Пользовательский Баланс - Обработка полной суммы… + В сумме учтены не все монеты Управление токенами Нет цены diff --git a/app/src/main/res/values/strings_final.xml b/app/src/main/res/values/strings_final.xml index 2478dee488..d59d31ff0e 100644 --- a/app/src/main/res/values/strings_final.xml +++ b/app/src/main/res/values/strings_final.xml @@ -47,7 +47,7 @@ Custom Total balance - Some networks are unreachable + The amount does not include some of your funds Manage tokens No rate diff --git a/domain/build.gradle b/domain/build.gradle index 378495cae1..169aea23f3 100644 --- a/domain/build.gradle +++ b/domain/build.gradle @@ -59,7 +59,7 @@ dependencies { implementation implementation(project(path: ':network')) implementation implementation(project(path: ':common')) - implementation 'com.tangem:blockchain:develop-87' + implementation 'com.tangem:blockchain:develop-88' // implementation 'com.tangem:blockchain:0.0.1' implementation 'com.tangem.tangem-sdk-kotlin:core:develop-154' implementation 'com.tangem.tangem-sdk-kotlin:android:develop-154'