mirror of
https://github.com/pezkuwichain/pezkuwi-wallet-android.git
synced 2026-06-19 18:11:09 +00:00
feat(assets): PEZ-20 badge on PEZ & USDT in token list
Show a small PEZ-20 pill next to PEZ and USDT (wUSDT) token rows in the main balance list. These are fungible assets on Pezkuwi Asset Hub — the PEZ-20 token standard. - item_token_asset.xml: add itemTokenAssetPez20 chip (gone by default). - TokenAssetViewHolder: show it when chainId == Pezkuwi Asset Hub and the symbol is PEZ/USDT/wUSDT. Additive only; native HEZ and other chains are unbadged. Consistent with the pex and Telegram mini app badges.
This commit is contained in:
+12
-1
@@ -1,5 +1,6 @@
|
||||
package io.novafoundation.nova.feature_assets.presentation.balance.common.holders
|
||||
|
||||
import androidx.core.view.isVisible
|
||||
import coil.ImageLoader
|
||||
import io.novafoundation.nova.common.list.GroupedListHolder
|
||||
import io.novafoundation.nova.common.presentation.masking.setMaskableText
|
||||
@@ -13,6 +14,11 @@ import io.novafoundation.nova.feature_assets.presentation.balance.list.model.ite
|
||||
import io.novafoundation.nova.feature_assets.presentation.model.AssetModel
|
||||
import io.novafoundation.nova.feature_wallet_api.presentation.model.maskableFiat
|
||||
import io.novafoundation.nova.feature_wallet_api.presentation.model.maskableToken
|
||||
import io.novafoundation.nova.runtime.ext.Geneses
|
||||
import io.novafoundation.nova.runtime.multiNetwork.chain.model.Chain
|
||||
|
||||
// Fungible assets on Pezkuwi Asset Hub follow the PEZ-20 token standard.
|
||||
private val PEZ20_SYMBOLS = setOf("PEZ", "USDT", "wUSDT")
|
||||
|
||||
class TokenAssetViewHolder(
|
||||
private val binder: ItemTokenAssetBinding,
|
||||
@@ -31,7 +37,12 @@ class TokenAssetViewHolder(
|
||||
|
||||
bindTotal(asset)
|
||||
|
||||
binder.itemTokenAssetToken.text = asset.token.configuration.symbol.value
|
||||
val config = asset.token.configuration
|
||||
binder.itemTokenAssetToken.text = config.symbol.value
|
||||
|
||||
val isPez20 = config.chainId == Chain.Geneses.PEZKUWI_ASSET_HUB && config.symbol.value in PEZ20_SYMBOLS
|
||||
binder.itemTokenAssetPez20.isVisible = isPez20
|
||||
if (isPez20) binder.itemTokenAssetPez20.text = "PEZ-20"
|
||||
|
||||
setOnClickListener { itemHandler.assetClicked(asset.token.configuration) }
|
||||
}
|
||||
|
||||
@@ -32,6 +32,24 @@
|
||||
app:layout_constraintVertical_chainStyle="packed"
|
||||
tools:text="DOT" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/itemTokenAssetPez20"
|
||||
style="@style/TextAppearance.NovaFoundation.Regular.Caption1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="6dp"
|
||||
android:background="@drawable/bg_chip_6"
|
||||
android:paddingHorizontal="6dp"
|
||||
android:paddingVertical="1dp"
|
||||
android:textColor="@color/chip_text"
|
||||
android:textSize="9sp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/itemTokenAssetToken"
|
||||
app:layout_constraintStart_toEndOf="@+id/itemTokenAssetToken"
|
||||
app:layout_constraintTop_toTopOf="@+id/itemTokenAssetToken"
|
||||
tools:text="PEZ-20"
|
||||
tools:visibility="visible" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/itemTokenAssetRateContainer"
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
Reference in New Issue
Block a user