Updated on 2026-08-14

This commit is contained in:
Tangem 2021-04-02 15:41:54 +03:00
parent cb37988cda
commit a1d81d9197
2 changed files with 26 additions and 10 deletions

View file

@ -8,7 +8,9 @@ import androidx.recyclerview.widget.ListAdapter
import androidx.recyclerview.widget.RecyclerView
import com.tangem.blockchain.common.Blockchain
import com.tangem.blockchain.common.Token
import com.tangem.tap.common.extensions.*
import com.tangem.tap.common.extensions.getColor
import com.tangem.tap.common.extensions.getIconRes
import com.tangem.tap.common.extensions.show
import com.tangem.tap.features.wallet.redux.WalletAction
import com.tangem.tap.features.wallet.redux.WalletData
import com.tangem.tap.features.wallet.ui.BalanceStatus
@ -80,11 +82,8 @@ class WalletAdapter
fun bind(wallet: WalletData) {
view.tv_currency.text = wallet.currencyData.currency
view.tv_amount.text = wallet.currencyData.amount
if (view.tv_amount.isEllipsized()) {
val allowedSize = view.tv_amount.text.length - 4
view.tv_amount.text = wallet.currencyData.amount?.ellipsizeBeforeSpace(allowedSize)
}
view.tv_amount.text = wallet.currencyData.amount?.takeWhile { !it.isWhitespace() }
view.tv_currency_symbol.text = wallet.currencyData.amount?.takeLastWhile { !it.isWhitespace() }
view.tv_amount_fiat.text = wallet.currencyData.fiatAmount
view.tv_exchange_rate.text = wallet.fiatRateString
view.card_wallet.setOnClickListener {

View file

@ -108,17 +108,34 @@
android:ellipsize="end"
android:gravity="end"
android:maxLines="1"
android:paddingStart="2dp"
android:paddingEnd="16dp"
android:layout_marginStart="2dp"
android:layout_marginTop="16dp"
android:textColor="@color/darkGray6"
android:textSize="17sp"
android:textStyle="bold"
app:layout_constraintEnd_toStartOf="@id/tv_currency_symbol"
app:layout_constraintHorizontal_weight="1"
app:layout_constraintStart_toEndOf="@id/tv_currency"
app:layout_constraintTop_toTopOf="parent"
tools:text="3 588" />
<TextView
android:id="@+id/tv_currency_symbol"
android:layout_width="wrap_content"
android:layout_height="24dp"
android:gravity="end"
android:maxLines="1"
android:layout_marginStart="4dp"
android:layout_marginEnd="16dp"
android:layout_marginTop="16dp"
android:textColor="@color/darkGray6"
android:textSize="17sp"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_weight="1"
app:layout_constraintStart_toEndOf="@id/tv_currency"
app:layout_constraintStart_toEndOf="@id/tv_amount"
app:layout_constraintTop_toTopOf="parent"
tools:text="3 588 BTC" />
tools:text="BTC" />
<TextView
android:id="@+id/tv_amount_fiat"