Updated on 2026-08-14

This commit is contained in:
Tangem 2022-05-30 15:19:44 +04:00
commit 185fffe11c
27 changed files with 405 additions and 322 deletions

View file

@ -170,6 +170,8 @@ dependencies {
implementation 'androidx.compose.ui:ui-tooling:1.1.1'
implementation "com.google.accompanist:accompanist-appcompat-theme:0.23.0"
implementation "com.github.skydoves:androidveil:1.1.2"
implementation("io.coil-kt:coil:2.0.0-rc01")
implementation("io.coil-kt:coil-compose:2.0.0-rc01")
@ -180,4 +182,4 @@ dependencies {
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
}

View file

@ -108,24 +108,22 @@ fun BigDecimal.isLessThanOrEqual(value: BigDecimal): Boolean {
fun BigDecimal.formatAmountAsSpannedString(
currencySymbol: String,
integerPartSizeProportion: Float = 1.4f
reminderPartSizeProportion: Float = 0.7f
): SpannedString {
val amount = this
.setScale(2, RoundingMode.HALF_UP)
.toString()
.formatWithSpaces()
val integer = amount.substringBefore('.')
val reminder = amount.substringAfter('.')
return buildSpannedString {
append(integer)
append('.')
append(
integer,
RelativeSizeSpan(integerPartSizeProportion),
"$reminder $currencySymbol",
RelativeSizeSpan(reminderPartSizeProportion),
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
)
append('.')
append(reminder)
append(' ')
append(currencySymbol)
}
}

View file

@ -21,6 +21,14 @@ import com.tangem.tap.domain.tokens.models.BlockchainNetwork
import com.tangem.tap.features.onboarding.products.twins.redux.TwinCardsState
import com.tangem.tap.features.tokens.redux.TokenWithBlockchain
import com.tangem.tap.features.wallet.models.*
import com.tangem.tap.features.wallet.models.PendingTransaction
import com.tangem.tap.features.wallet.models.TotalBalance
import com.tangem.tap.features.wallet.models.WalletRent
import com.tangem.tap.features.wallet.models.WalletWarning
import com.tangem.tap.features.wallet.models.toPendingTransactions
import com.tangem.tap.features.wallet.models.toPendingTransactionsForToken
import com.tangem.tap.features.wallet.redux.reducers.calculateTotalFiatAmount
import com.tangem.tap.features.wallet.redux.reducers.findTotalBalanceState
import com.tangem.tap.features.wallet.ui.BalanceStatus
import com.tangem.tap.features.wallet.ui.BalanceWidgetData
import com.tangem.tap.network.exchangeServices.CurrencyExchangeManager
@ -189,11 +197,11 @@ data class WalletState(
.distinct().map { getWalletStore(it) }.mapNotNull { it?.updateWallets(walletsData) }
return updateWalletStores(walletStores)
}
fun updateWalletStore(walletStore: WalletStore?): WalletState {
return copy(wallets = replaceWalletInWallets(walletStore))
.updateTotalBalance()
}
private fun updateWalletStores(walletStores: List<WalletStore>): WalletState {
@ -210,6 +218,7 @@ data class WalletState(
}
}
return copy(wallets = updatedWallets + walletStoresMutable)
.updateTotalBalance()
}
fun removeWallet(walletData: WalletData?): WalletState {
@ -271,11 +280,18 @@ data class WalletState(
}
}
fun updateTotalBalance(
totalBalance: TotalBalance?
): WalletState {
return this.copy(
totalBalance = totalBalance
private fun updateTotalBalance(): WalletState {
return if (wallets.isNotEmpty()) {
val walletsData = wallets.flatMap(WalletStore::walletsData)
this.copy(
totalBalance = TotalBalance(
state = walletsData.findTotalBalanceState(),
fiatAmount = walletsData.calculateTotalFiatAmount(),
fiatCurrency = store.state.globalState.appCurrency
)
)
} else this.copy(
totalBalance = null
)
}
}

View file

@ -10,7 +10,12 @@ import com.tangem.tap.domain.getFirstToken
import com.tangem.tap.domain.tokens.models.BlockchainNetwork
import com.tangem.tap.features.wallet.models.removeUnknownTransactions
import com.tangem.tap.features.wallet.models.toPendingTransactions
import com.tangem.tap.features.wallet.redux.*
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.ui.BalanceStatus
import com.tangem.tap.features.wallet.ui.BalanceWidgetData
import com.tangem.tap.features.wallet.ui.TokenData
@ -126,7 +131,7 @@ class MultiWalletReducer {
),
fiatAmountFormatted = tokenWalletData.fiatRate?.let {
action.amount.value
?.toFiatString(it, store.state.globalState.appCurrency.code)
?.toFiatString(it, store.state.globalState.appCurrency.symbol)
},
blockchainAmount = wallet.amounts[AmountType.Coin]?.value ?: BigDecimal.ZERO
),

View file

@ -11,7 +11,11 @@ import com.tangem.tap.domain.getFirstToken
import com.tangem.tap.domain.tokens.models.BlockchainNetwork
import com.tangem.tap.features.wallet.models.removeUnknownTransactions
import com.tangem.tap.features.wallet.models.toPendingTransactions
import com.tangem.tap.features.wallet.redux.*
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.ui.BalanceStatus
import com.tangem.tap.features.wallet.ui.BalanceWidgetData
import com.tangem.tap.features.wallet.ui.TokenData
@ -97,7 +101,7 @@ class OnWalletLoadedReducer {
token.symbol
),
fiatAmount = tokenFiatAmount,
fiatAmountFormatted = tokenFiatAmount?.toFormattedFiatValue(fiatCurrency.code)
fiatAmountFormatted = tokenFiatAmount?.toFormattedFiatValue(fiatCurrency.symbol)
),
pendingTransactions = tokenPendingTransactions.removeUnknownTransactions(),
mainButton = WalletMainButton.SendButton(tokenSendButton),
@ -114,9 +118,6 @@ class OnWalletLoadedReducer {
}
return walletState
.updateWalletsData(wallets)
.updateTotalBalance(
totalBalance = obtainTotalBalance(wallets, fiatCurrency)
)
.copy(
state = state,
error = null

View file

@ -1,37 +1,21 @@
package com.tangem.tap.features.wallet.redux.reducers
import com.tangem.tap.common.entities.FiatCurrency
import com.tangem.tap.features.wallet.models.TotalBalance
import com.tangem.tap.features.wallet.redux.WalletData
import com.tangem.tap.features.wallet.ui.BalanceStatus
import java.math.BigDecimal
fun obtainTotalBalance(
wallets: List<WalletData>,
appCurrency: FiatCurrency
): TotalBalance? {
return if (wallets.isNotEmpty()) {
TotalBalance(
state = wallets.findTotalBalanceState(),
fiatAmount = wallets.calculateTotalFiatAmount(),
fiatCurrency = appCurrency
)
} else null
}
private fun List<WalletData>.findTotalBalanceState(): TotalBalance.State {
fun List<WalletData>.findTotalBalanceState(): TotalBalance.State {
return this.mapToTotalBalanceState()
.fold(initial = TotalBalance.State.Loading) { accState, newState ->
accState or newState
}
.reduce(TotalBalance.State::or)
}
private fun List<WalletData>.calculateTotalFiatAmount(): BigDecimal {
fun List<WalletData>.calculateTotalFiatAmount(): BigDecimal {
return this.map { it.currencyData.fiatAmount ?: BigDecimal.ZERO }
.reduce(BigDecimal::plus)
}
private fun List<WalletData>.mapToTotalBalanceState(): List<TotalBalance.State> {
fun List<WalletData>.mapToTotalBalanceState(): List<TotalBalance.State> {
return this.map {
when (it.currencyData.status) {
BalanceStatus.VerifiedOnline,
@ -50,9 +34,9 @@ private fun List<WalletData>.mapToTotalBalanceState(): List<TotalBalance.State>
infix fun TotalBalance.State.or(newState: TotalBalance.State): TotalBalance.State {
return when (this) {
TotalBalance.State.Loading -> when (newState) {
TotalBalance.State.Loading -> this
TotalBalance.State.Loading,
TotalBalance.State.SomeTokensFailed,
TotalBalance.State.Success -> newState
TotalBalance.State.Success -> this
}
TotalBalance.State.Success,
TotalBalance.State.SomeTokensFailed -> when (newState) {

View file

@ -16,12 +16,24 @@ import com.tangem.tap.domain.extensions.getArtworkUrl
import com.tangem.tap.domain.getFirstToken
import com.tangem.tap.domain.tokens.models.BlockchainNetwork
import com.tangem.tap.features.wallet.models.WalletRent
import com.tangem.tap.features.wallet.redux.*
import com.tangem.tap.features.wallet.redux.AddressData
import com.tangem.tap.features.wallet.redux.Artwork
import com.tangem.tap.features.wallet.redux.Currency
import com.tangem.tap.features.wallet.redux.ErrorType
import com.tangem.tap.features.wallet.redux.ProgressState
import com.tangem.tap.features.wallet.redux.TradeCryptoState
import com.tangem.tap.features.wallet.redux.WalletAction
import com.tangem.tap.features.wallet.redux.WalletAddresses
import com.tangem.tap.features.wallet.redux.WalletData
import com.tangem.tap.features.wallet.redux.WalletDialog
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.ui.BalanceStatus
import com.tangem.tap.features.wallet.ui.BalanceWidgetData
import com.tangem.tap.store
import org.rekotlin.Action
import java.math.BigDecimal
import org.rekotlin.Action
class WalletReducer {
companion object {
@ -436,9 +448,6 @@ private fun setMultiWalletFiatRate(
return state
.updateWalletsData(newWalletsData)
.updateTotalBalance(
totalBalance = obtainTotalBalance(newWalletsData, appCurrency)
)
}
private fun setSingleWalletFiatRate(

View file

@ -24,7 +24,11 @@ import com.tangem.tap.domain.statePrinter.printScanResponseState
import com.tangem.tap.domain.statePrinter.printWalletState
import com.tangem.tap.domain.termsOfUse.CardTou
import com.tangem.tap.features.details.redux.DetailsAction
import com.tangem.tap.features.wallet.redux.*
import com.tangem.tap.features.wallet.redux.Artwork
import com.tangem.tap.features.wallet.redux.ErrorType
import com.tangem.tap.features.wallet.redux.ProgressState
import com.tangem.tap.features.wallet.redux.WalletAction
import com.tangem.tap.features.wallet.redux.WalletState
import com.tangem.tap.features.wallet.ui.adapters.WarningMessagesAdapter
import com.tangem.tap.features.wallet.ui.wallet.MultiWalletView
import com.tangem.tap.features.wallet.ui.wallet.SingleWalletView
@ -78,7 +82,7 @@ class WalletFragment : Fragment(R.layout.fragment_wallet), StoreSubscriber<Walle
(activity as? AppCompatActivity)?.setSupportActionBar(binding.toolbar)
binding.toolbar.setNavigationOnClickListener {
store.dispatch(NavigationAction.PopBackTo(AppScreen.Home))
store.dispatch(WalletAction.Scan)
}
setupWarningsRecyclerView()
walletView.changeWalletView(this, binding)

View file

@ -2,6 +2,7 @@ package com.tangem.tap.features.wallet.ui.adapters
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.core.view.isVisible
import androidx.recyclerview.widget.DiffUtil
import androidx.recyclerview.widget.ListAdapter
import androidx.recyclerview.widget.RecyclerView
@ -10,6 +11,7 @@ import com.tangem.blockchain.common.Blockchain
import com.tangem.blockchain.common.Token
import com.tangem.domain.common.TapWorkarounds.derivationStyle
import com.tangem.tap.common.extensions.getString
import com.tangem.tap.common.extensions.hide
import com.tangem.tap.common.extensions.loadCurrenciesIcon
import com.tangem.tap.common.extensions.show
import com.tangem.tap.features.wallet.redux.Currency
@ -61,57 +63,63 @@ class WalletAdapter
RecyclerView.ViewHolder(binding.root) {
fun bind(wallet: WalletData) = with(binding) {
tvCurrency.text = wallet.currencyData.currency
tvAmount.text = wallet.currencyData.amountFormatted.orEmpty()
tvAmountFiat.text = wallet.currencyData.fiatAmountFormatted
tvExchangeRate.text = wallet.fiatRateString
cardWallet.setOnClickListener {
store.dispatch(WalletAction.MultiWallet.SelectWallet(wallet))
val status = wallet.currencyData.status
val isCustomCurrency = wallet.currency.isCustomCurrency(
derivationStyle = store.state.globalState
.scanResponse
?.card
?.derivationStyle
)
val statusMessage = when (status) {
BalanceStatus.TransactionInProgress -> {
root.getString(R.string.wallet_balance_tx_in_progress)
}
BalanceStatus.Unreachable -> {
root.getString(R.string.wallet_balance_blockchain_unreachable)
}
BalanceStatus.NoAccount -> {
root.getString(R.string.wallet_error_no_account)
}
BalanceStatus.VerifiedOnline,
BalanceStatus.SameCurrencyTransactionInProgress,
BalanceStatus.EmptyCard,
BalanceStatus.UnknownBlockchain,
BalanceStatus.Loading,
null -> null
}
val blockchain = wallet.currency.blockchain
val token = (wallet.currency as? Currency.Token)?.token
val isCustom = wallet.currency
.isCustomCurrency(store.state.globalState.scanResponse?.card?.derivationStyle)
tvExchangeRate.show(!isCustom)
tvCustomCurrency.show(isCustom)
if (status == null || status == BalanceStatus.Loading) {
lContent.root.hide()
lShimmer.root.veil()
} else {
lShimmer.root.unVeil()
lContent.root.show()
}
Picasso.get().loadCurrenciesIcon(
imageView = ivCurrency,
textView = tvTokenLetter,
token = token, blockchain = blockchain,
token = (wallet.currency as? Currency.Token)?.token,
blockchain = wallet.currency.blockchain,
)
when (wallet.currencyData.status) {
BalanceStatus.VerifiedOnline,
BalanceStatus.SameCurrencyTransactionInProgress -> hideMessage()
BalanceStatus.Loading -> if (wallet.currencyData.amountFormatted == null) {
showMessage(root.getString(R.string.wallet_balance_loading))
}
BalanceStatus.TransactionInProgress ->
showMessage(root.getString(R.string.wallet_balance_tx_in_progress))
BalanceStatus.Unreachable ->
showMessage(root.getString(R.string.wallet_balance_blockchain_unreachable))
lContent.tvCurrency.text = wallet.currencyData.currency
lContent.tvAmountFiat.text = wallet.currencyData.fiatAmountFormatted ?: ""
lContent.tvAmount.text = wallet.currencyData.amountFormatted ?: ""
BalanceStatus.NoAccount ->
showMessage(root.getString(R.string.wallet_error_no_account))
else -> {
}
lContent.tvStatus.isVisible = statusMessage != null
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
}
}
private fun showMessage(message: String) {
toggleMessage(true)
binding.tvStatus.text = message
}
private fun hideMessage() {
toggleMessage(false)
}
private fun toggleMessage(show: Boolean) {
binding.tvAmount.show(!show)
binding.tvStatus.show(show)
cardWallet.setOnClickListener {
store.dispatch(WalletAction.MultiWallet.SelectWallet(wallet))
}
}
}
}

View file

@ -1,7 +1,7 @@
package com.tangem.tap.features.wallet.ui.wallet
import android.app.Dialog
import android.view.View
import androidx.core.view.isVisible
import androidx.recyclerview.widget.LinearLayoutManager
import com.tangem.common.card.Card
import com.tangem.domain.common.TapWorkarounds.derivationStyle
@ -41,7 +41,6 @@ class MultiWalletView : WalletView {
setFragment(fragment, binding)
onViewCreated()
showMultiWalletView(binding)
setupButtons(binding)
}
@ -52,7 +51,6 @@ class MultiWalletView : WalletView {
lAddress.root.hide()
lButtonsShort.root.hide()
lButtonsLong.root.hide()
btnScanMultiwallet.show()
rvMultiwallet.show()
btnAddToken.show()
setupWalletCardNumber(binding)
@ -70,11 +68,6 @@ class MultiWalletView : WalletView {
}
}
private fun setupButtons(binding: FragmentWalletBinding) = with(binding) {
btnScanMultiwallet.setOnClickListener { store.dispatch(WalletAction.Scan) }
}
override fun setFragment(fragment: WalletFragment, binding: FragmentWalletBinding) {
this.fragment = fragment
this.binding = binding
@ -136,29 +129,26 @@ class MultiWalletView : WalletView {
binding: FragmentWalletBinding,
totalBalance: TotalBalance?,
) = with(binding.lCardTotalBalance) {
if (totalBalance == null) {
this.root.hide()
return@with
}
root.isVisible = totalBalance != null
if (totalBalance != null) {
if (totalBalance.state == TotalBalance.State.Loading) {
veilBalance.veil()
} else {
veilBalance.unVeil()
}
tvProcessing.animateVisibility(
show = totalBalance.state == TotalBalance.State.SomeTokensFailed
)
tvBalance.animateVisibility(
show = totalBalance.state != TotalBalance.State.Loading,
hiddenVisibility = View.INVISIBLE
)
pbLoading.animateVisibility(
show = totalBalance.state == TotalBalance.State.Loading
)
tvProcessing.animateVisibility(
show = totalBalance.state == TotalBalance.State.SomeTokensFailed
)
tvBalance.text = if (totalBalance.state == TotalBalance.State.SomeTokensFailed) ""
else totalBalance.fiatAmount.formatAmountAsSpannedString(
currencySymbol = totalBalance.fiatCurrency.symbol
)
tvCurrencyName.text = totalBalance.fiatCurrency.code
tvBalance.text = totalBalance.fiatAmount.formatAmountAsSpannedString(
currencySymbol = totalBalance.fiatCurrency.symbol
)
tvCurrencyName.text = totalBalance.fiatCurrency.code
tvCurrencyName.setOnClickListener {
store.dispatch(WalletAction.AppCurrencyAction.ChooseAppCurrency)
tvCurrencyName.setOnClickListener {
store.dispatch(WalletAction.AppCurrencyAction.ChooseAppCurrency)
}
}
}
@ -204,7 +194,6 @@ class MultiWalletView : WalletView {
private fun configureButtonsForEmptyWalletState(binding: FragmentWalletBinding) =
with(binding) {
btnScanMultiwallet.hide()
lButtonsLong.root.show()
lButtonsLong.btnScanLong.setOnClickListener { store.dispatch(WalletAction.Scan) }
lButtonsLong.btnConfirmLong.setOnClickListener { store.dispatch(WalletAction.CreateWallet) }

View file

@ -13,7 +13,13 @@ import com.tangem.tap.common.extensions.show
import com.tangem.tap.common.redux.StateDialog
import com.tangem.tap.features.onboarding.products.twins.redux.TwinCardsState
import com.tangem.tap.features.wallet.models.PendingTransaction
import com.tangem.tap.features.wallet.redux.*
import com.tangem.tap.features.wallet.redux.Currency
import com.tangem.tap.features.wallet.redux.TradeCryptoState
import com.tangem.tap.features.wallet.redux.WalletAction
import com.tangem.tap.features.wallet.redux.WalletData
import com.tangem.tap.features.wallet.redux.WalletDialog
import com.tangem.tap.features.wallet.redux.WalletMainButton
import com.tangem.tap.features.wallet.redux.WalletState
import com.tangem.tap.features.wallet.ui.BalanceWidget
import com.tangem.tap.features.wallet.ui.MultipleAddressUiHelper
import com.tangem.tap.features.wallet.ui.WalletFragment
@ -51,7 +57,6 @@ class SingleWalletView : WalletView {
private fun showSingleWalletView(binding: FragmentWalletBinding) = with(binding) {
rvMultiwallet.hide()
btnAddToken.hide()
btnScanMultiwallet.hide()
rvPendingTransaction.hide()
lCardBalance.root.show()
lAddress.root.show()

View file

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M12,8C13.1,8 14,7.1 14,6C14,4.9 13.1,4 12,4C10.9,4 10,4.9 10,6C10,7.1 10.9,8 12,8ZM12,10C10.9,10 10,10.9 10,12C10,13.1 10.9,14 12,14C13.1,14 14,13.1 14,12C14,10.9 13.1,10 12,10ZM12,16C10.9,16 10,16.9 10,18C10,19.1 10.9,20 12,20C13.1,20 14,19.1 14,18C14,16.9 13.1,16 12,16Z"
android:fillColor="#000"
android:fillType="evenOdd" />
</vector>

View file

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:pathData="M17,12C17,9.24 14.76,7 12,7C9.24,7 7,9.24 7,12C7,14.76 9.24,17 12,17C14.76,17 17,14.76 17,12ZM12,15C10.35,15 9,13.65 9,12C9,10.35 10.35,9 12,9C13.65,9 15,10.35 15,12C15,13.65 13.65,15 12,15ZM5,15H3V19C3,20.1 3.9,21 5,21H9V19H5V15ZM5,5H9V3H5C3.9,3 3,3.9 3,5V9H5V5ZM19,3H15V5H19V9H21V5C21,3.9 20.1,3 19,3ZM19,19H15V21H19C20.1,21 21,20.1 21,19V15H19V19Z"
android:fillColor="#000"
android:fillType="evenOdd" />
</vector>

View file

@ -22,10 +22,10 @@
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="18dp"
android:paddingBottom="18dp"
android:paddingStart="16dp"
android:paddingEnd="16dp"
android:layout_marginTop="18dp"
android:layout_marginBottom="18dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:animateLayoutChanges="true">
<TextView
@ -40,33 +40,35 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toStartOf="@id/tv_currency_name" />
<TextView
android:id="@+id/tv_balance"
<com.skydoves.androidveil.VeilLayout
android:id="@+id/veil_balance"
android:layout_width="0dp"
android:layout_height="32dp"
android:layout_height="wrap_content"
android:layout_marginTop="4dp"
android:visibility="gone"
android:maxLines="1"
android:textColor="@color/darkGray6"
android:textSize="20sp"
android:textStyle="bold"
app:veilLayout_layout="@layout/card_total_balance_shimmer"
app:veilLayout_baseColor="@color/lightGray0"
app:veilLayout_highlightColor="@color/lightGray1"
app:veilLayout_shimmerEnable="true"
app:veilLayout_veiled="true"
app:veilLayout_radius="4dp"
app:layout_constraintTop_toBottomOf="@id/tv_title"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
tools:text="$ 22 325.40"
tools:visibility="visible" />
tools:veilLayout_veiled="false">
<ProgressBar
android:id="@+id/pb_loading"
android:layout_width="32dp"
android:layout_height="32dp"
android:layout_marginTop="4dp"
android:padding="2dp"
android:visibility="gone"
android:indeterminate="true"
android:indeterminateTint="@color/accent"
app:layout_constraintTop_toBottomOf="@id/tv_title"
app:layout_constraintStart_toStartOf="parent" />
<TextView
android:id="@+id/tv_balance"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:minWidth="152dp"
android:maxLines="1"
android:textColor="@color/darkGray6"
android:textSize="26sp"
android:textStyle="bold"
tools:text="22 325.40 $" />
</com.skydoves.androidveil.VeilLayout>
<TextView
android:id="@+id/tv_processing"
@ -77,7 +79,7 @@
android:textColor="@color/warning"
android:textSize="12sp"
android:text="@string/main_processing_full_amount"
app:layout_constraintTop_toBottomOf="@id/tv_balance"
app:layout_constraintTop_toBottomOf="@id/veil_balance"
app:layout_constraintStart_toStartOf="parent" />
<TextView

View file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<View
android:layout_width="124dp"
android:layout_height="22dp"
android:layout_marginTop="12dp" />
</FrameLayout>

View file

@ -8,4 +8,4 @@
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -18,12 +18,13 @@
app:liftOnScroll="true">
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:menu="@menu/wallet"
app:navigationIcon="@drawable/ic_baseline_arrow_back_24"
app:title="@string/wallet_title" />
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:menu="@menu/wallet"
app:navigationIcon="@drawable/ic_scan_card_24"
app:navigationIconTint="@color/iconGray"
app:title="@string/wallet_title" />
</com.google.android.material.appbar.AppBarLayout>
@ -41,19 +42,20 @@
android:overScrollMode="never">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_wallet"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/iv_card"
android:id="@+id/cl_wallet"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="12dp"
android:paddingBottom="74dp">
<ImageView
android:id="@+id/iv_card"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="12dp"
android:adjustViewBounds="true"
android:elevation="3dp"
android:maxHeight="215dp"
@ -149,26 +151,6 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/rv_pending_transaction" />
<com.google.android.material.card.MaterialCardView
android:id="@+id/btn_add_token"
android:layout_width="match_parent"
android:layout_height="52dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="32dp"
android:background="@android:color/white"
android:elevation="3dp"
app:layout_constraintTop_toBottomOf="@id/rv_multiwallet">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:text="@string/wallet_button_add_tokens"
android:textSize="14sp" />
</com.google.android.material.card.MaterialCardView>
<include
android:id="@+id/l_buttons_long"
layout="@layout/layout_wallet_long_buttons"
@ -186,27 +168,10 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:visibility="gone"
android:layout_marginTop="30dp"
app:layout_constraintTop_toBottomOf="@id/l_address"
app:layout_constraintVertical_bias="1"
app:layout_constraintBottom_toBottomOf="parent" />
<com.google.android.material.button.MaterialButton
android:id="@+id/btn_scan_multiwallet"
style="@style/TapBlackButton"
android:layout_width="wrap_content"
android:minWidth="100dp"
android:layout_marginStart="16dp"
android:layout_marginTop="30dp"
android:layout_marginBottom="33dp"
android:text="@string/wallet_button_scan"
app:icon="@drawable/ic_scan"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/btn_add_token"
app:layout_constraintVertical_bias="1" />
android:layout_marginTop="30dp"
app:layout_constraintTop_toBottomOf="@id/l_address"
app:layout_constraintVertical_bias="1"
app:layout_constraintBottom_toBottomOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
@ -214,4 +179,19 @@
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
<com.google.android.material.button.MaterialButton
android:id="@+id/btn_add_token"
style="@style/BaseTapButton"
android:layout_width="match_parent"
android:layout_height="42dp"
android:layout_gravity="bottom"
android:layout_marginBottom="16dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:textSize="16sp"
android:text="@string/main_manage_tokens"
android:elevation="4dp"
app:cornerRadius="8dp"
app:layout_constraintBottom_toBottomOf="parent" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>

View file

@ -21,7 +21,8 @@
android:layout_marginTop="12dp"
android:layout_marginBottom="12dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp">
android:layout_marginEnd="16dp"
android:animateLayoutChanges="true">
<androidx.constraintlayout.utils.widget.ImageFilterView
android:id="@+id/iv_currency"
@ -46,112 +47,25 @@
app:layout_constraintTop_toTopOf="@id/iv_currency"
tools:text="J" />
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline_horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintGuide_percent="0.5" />
<TextView
android:id="@+id/tv_currency"
<include
layout="@layout/item_currency_wallet_content"
android:id="@+id/l_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:layout_marginEnd="8dp"
android:ellipsize="end"
android:maxLines="1"
android:textColor="@color/darkGray6"
android:textSize="16sp"
android:textStyle="bold"
app:lineHeight="24dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toTopOf="@id/guideline_horizontal"
app:layout_constraintStart_toEndOf="@id/iv_currency"
app:layout_constraintEnd_toStartOf="@+id/tv_amount_fiat"
tools:text="Binance Smart Chain Optimal" />
<TextView
android:id="@+id/tv_amount_fiat"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:textColor="@color/darkGray6"
android:textSize="16sp"
android:textStyle="bold"
android:textAlignment="viewEnd"
app:lineHeight="24dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toTopOf="@id/guideline_horizontal"
app:layout_constraintEnd_toEndOf="parent"
tools:text="1230.43 $" />
<TextView
android:id="@+id/tv_amount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:textColor="@color/darkGray2"
android:textSize="12sp"
android:textAlignment="viewEnd"
app:lineHeight="20dp"
app:layout_constraintTop_toBottomOf="@id/guideline_horizontal"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
tools:text="2.002134 BTC" />
<TextView
android:id="@+id/tv_status"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_height="match_parent"
android:layout_marginStart="8dp"
android:visibility="gone"
android:maxLines="1"
android:ellipsize="end"
android:textColor="@color/darkGray2"
android:textSize="12sp"
android:textAlignment="viewEnd"
app:lineHeight="20dp"
app:layout_constraintTop_toBottomOf="@id/guideline_horizontal"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/barrier_rate_custom"
app:layout_constraintEnd_toEndOf="parent"
tools:text="Unreachable..." />
<TextView
android:id="@+id/tv_exchange_rate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:maxLines="1"
android:textColor="@color/darkGray2"
android:textSize="12sp"
app:lineHeight="20dp"
app:layout_constraintTop_toBottomOf="@id/guideline_horizontal"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/iv_currency"
tools:text="46 908 $" />
app:layout_constraintEnd_toEndOf="parent"
tools:visibility="visible" />
<TextView
android:id="@+id/tv_custom_currency"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
<include
layout="@layout/item_currency_wallet_shimmer"
android:id="@+id/l_shimmer"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginStart="8dp"
android:textColor="@color/darkGray2"
android:textSize="14sp"
android:text="@string/common_custom"
android:visibility="gone"
app:layout_constraintTop_toBottomOf="@id/guideline_horizontal"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/iv_currency" />
<androidx.constraintlayout.widget.Barrier
android:id="@+id/barrier_rate_custom"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:constraint_referenced_ids="tv_exchange_rate,tv_custom_currency"
app:barrierDirection="end" />
app:layout_constraintStart_toEndOf="@id/iv_currency"
app:layout_constraintEnd_toEndOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.material.card.MaterialCardView>

View file

@ -0,0 +1,90 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="42dp">
<androidx.constraintlayout.widget.Guideline
android:id="@+id/guideline_horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintGuide_percent="0.5" />
<TextView
android:id="@+id/tv_currency"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:ellipsize="end"
android:maxLines="1"
android:textColor="@color/darkGray6"
android:textSize="16sp"
android:textStyle="bold"
app:lineHeight="24dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toTopOf="@id/guideline_horizontal"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toStartOf="@+id/tv_amount_fiat"
tools:text="Binance Smart Chain Optimal" />
<TextView
android:id="@+id/tv_amount_fiat"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:textColor="@color/darkGray6"
android:textSize="16sp"
android:textStyle="bold"
android:textAlignment="viewEnd"
app:lineHeight="24dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toTopOf="@id/guideline_horizontal"
app:layout_constraintEnd_toEndOf="parent"
tools:text="1230.43 $" />
<TextView
android:id="@+id/tv_amount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:textColor="@color/darkGray2"
android:textSize="12sp"
android:textAlignment="viewEnd"
app:lineHeight="20dp"
app:layout_constraintTop_toBottomOf="@id/guideline_horizontal"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
tools:text="2.002134 BTC" />
<TextView
android:id="@+id/tv_status"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:visibility="gone"
android:maxLines="1"
android:ellipsize="end"
android:textColor="@color/warning"
android:textSize="12sp"
app:lineHeight="20dp"
app:layout_constraintTop_toBottomOf="@id/guideline_horizontal"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
tools:text="Unreachable..." />
<TextView
android:id="@+id/tv_exchange_rate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:textColor="@color/darkGray2"
android:textSize="12sp"
app:lineHeight="20dp"
app:layout_constraintTop_toBottomOf="@id/guideline_horizontal"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
tools:text="46 908 $" />
</androidx.constraintlayout.widget.ConstraintLayout>

View file

@ -0,0 +1,40 @@
<com.skydoves.androidveil.VeilLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="42dp"
app:veilLayout_baseColor="@color/lightGray0"
app:veilLayout_highlightColor="@color/lightGray1"
app:veilLayout_shimmerEnable="true"
app:veilLayout_veiled="true"
app:veilLayout_radius="4dp"
tools:veilLayout_veiled="false">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="4dp"
android:layout_marginBottom="4dp">
<View
android:layout_width="72dp"
android:layout_height="12dp"
android:layout_gravity="top|start" />
<View
android:layout_width="42dp"
android:layout_height="12dp"
android:layout_gravity="top|end" />
<View
android:layout_width="52dp"
android:layout_height="12dp"
android:layout_gravity="bottom|start" />
<View
android:layout_width="42dp"
android:layout_height="12dp"
android:layout_gravity="bottom|end" />
</FrameLayout>
</com.skydoves.androidveil.VeilLayout>

View file

@ -2,8 +2,9 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/details_menu"
android:title="@string/details_title"
android:icon="@drawable/ic_settings"
app:showAsAction="ifRoom" />
</menu>
android:id="@+id/details_menu"
android:title="@string/details_title"
android:icon="@drawable/ic_more_vertical_24"
app:iconTint="@color/iconGray"
app:showAsAction="ifRoom" />
</menu>

View file

@ -382,6 +382,4 @@
<string name="feedback_preface_support">Привет, команда поддержки,</string>
<string name="feedback_preface_tx_push_failed">Пожалуйста, расскажите нам больше о Вашей проблеме. Каждая деталь может быть полезной.</string>
<string name="feedback_data_collection_message">Информация ниже не является обязательной. Вы можете стереть её, если хотите.</string>
<string name="main_page_balance">Баланс</string>
<string name="main_processing_full_amount">Обработка полной суммы…</string>
</resources>

View file

@ -40,10 +40,14 @@
<string name="currency_subtitle_expanded">Доступные сети</string>
<string name="alert_manage_tokens_addresses_message">Внимание! Валюты на разных сетях имеют разные адреса. Убедитесь, что адрес соответствует сети, в которой вы отправляете средства.</string>
<string name="alert_manage_tokens_unsupported_message">Токены в сети Solana не поддерживаются этой картой из-за ограничений прошивки.</string>
<string name="warning_token_send_unsupported_message">Не осуществляйте перевод на токены в данной сети иначе это может привести к их безвозвратной утере.</string>
<string name="warning_token_send_unsupported_message">Не осуществляйте перевод на токены в данной сети, иначе это может привести к их безвозвратной утере.</string>
<string name="contract_address_copied_message">Адрес контракта скопирован!</string>
<string name="alert_funds_restoration_message">Если вы совершили ошибку с выбором сети при переводе средств с биржи, эта инструкция поможет вам восстановить средства</string>
<string name="common_custom">Пользовательский</string>
</resources>
<string name="main_page_balance">Баланс</string>
<string name="main_processing_full_amount">Обработка полной суммы…</string>
<string name="main_manage_tokens">Управление токенами</string>
<string name="token_item_no_rate">Нет цены</string>
</resources>

View file

@ -30,6 +30,7 @@
<dimen name="size_progress_bar_big">135dp</dimen>
<dimen name="btn_corner_radius">4dp</dimen>
<dimen name="btn_corner_radius_medium">8dp</dimen>
<dimen name="btn_rounded_size">44dp</dimen>
<dimen name="text_size_amount_to_send">32sp</dimen>

View file

@ -206,6 +206,4 @@
<string name="xtz_withdrawal_message_warning">To avoid paying an increased commission the next time you top up your wallet, reduce the amount by %s XTZ</string>
<string name="xtz_withdrawal_message_reduce">Reduce by %s XTZ</string>
<string name="xtz_withdrawal_message_ignore">No, send all</string>
<string name="main_page_balance">Total balance</string>
<string name="main_processing_full_amount">Processing full amount…</string>
</resources>

View file

@ -46,4 +46,8 @@
<string name="common_custom">Custom</string>
</resources>
<string name="main_page_balance">Total balance</string>
<string name="main_processing_full_amount">Some networks are unreachable</string>
<string name="main_manage_tokens">Manage tokens</string>
<string name="token_item_no_rate">No rate</string>
</resources>

View file

@ -160,7 +160,6 @@
<style name="Widget.AppTheme.CardView" parent="Widget.MaterialComponents.CardView">
<item name="cardCornerRadius">8dp</item>
</style>
</resources>
<!-- android:fontFamily="sans-serif" // roboto regular -->