Updated on 2026-08-14
This commit is contained in:
parent
b4544ed2b4
commit
1079568b3e
5 changed files with 168 additions and 127 deletions
|
|
@ -103,8 +103,10 @@ public class TangemCard {
|
|||
if (Strings.isNullOrEmpty(token))
|
||||
return;
|
||||
String oldName = getBlockchain().getOfficialName();
|
||||
String newName = String.format("%s (%s)", oldName, token);
|
||||
//String newName = String.format("%s - %s ERC20 token", token, oldName);
|
||||
String newName = token + " <br><small><small> " + oldName + " ERC20 token</small></small>";
|
||||
setBlockchainName(newName);
|
||||
|
||||
}
|
||||
|
||||
private String blochchainName = "";
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import android.nfc.Tag
|
|||
import android.nfc.tech.IsoDep
|
||||
import android.os.Bundle
|
||||
import android.support.v7.app.AppCompatActivity
|
||||
import android.text.Html
|
||||
import android.view.View
|
||||
import android.widget.Toast
|
||||
import com.tangem.data.nfc.VerifyCardTask
|
||||
|
|
@ -49,7 +50,13 @@ class EmptyWalletActivity : AppCompatActivity(), NfcAdapter.ReaderCallback, Card
|
|||
card!!.loadFromBundle(intent.extras!!.getBundle("Card"))
|
||||
|
||||
tvIssuer.text = card!!.issuerDescription
|
||||
tvBlockchain.text = card!!.blockchainName
|
||||
//tvBlockchain.text = card!!.blockchainName
|
||||
if (card!!.tokenSymbol.length > 1) {
|
||||
val html = Html.fromHtml(card!!.blockchainName)
|
||||
tvBlockchain.text = html
|
||||
} else
|
||||
tvBlockchain.text = card!!.blockchainName
|
||||
|
||||
tvCardID.text = card!!.cidDescription
|
||||
imgBlockchain.setImageResource(card!!.blockchain.getImageResource(this, card!!.tokenSymbol))
|
||||
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ import com.tangem.wallet.BuildConfig
|
|||
import com.tangem.wallet.R
|
||||
import kotlinx.android.synthetic.main.fr_loaded_wallet.*
|
||||
import org.json.JSONException
|
||||
import java.math.BigDecimal
|
||||
import java.math.BigInteger
|
||||
import java.util.*
|
||||
|
||||
|
|
@ -110,12 +111,6 @@ class LoadedWallet : Fragment(), NfcAdapter.ReaderCallback, CardProtocol.Notific
|
|||
val engine = CoinEngineFactory.create(card!!.blockchain)
|
||||
val visibleFlag = engine?.inOutPutVisible() ?: true
|
||||
|
||||
try {
|
||||
ivQR.setImageBitmap(UtilHelper.generateQrCode(engine.getShareWalletUri(card).toString()))
|
||||
} catch (e: WriterException) {
|
||||
e.printStackTrace()
|
||||
}
|
||||
|
||||
btnExtract.isEnabled = false
|
||||
btnExtract.backgroundTintList = inactiveColor
|
||||
|
||||
|
|
@ -134,7 +129,6 @@ class LoadedWallet : Fragment(), NfcAdapter.ReaderCallback, CardProtocol.Notific
|
|||
}
|
||||
btnCopy.setOnClickListener { doShareWallet(false) }
|
||||
tvWallet.setOnClickListener { doShareWallet(false) }
|
||||
ivQR.setOnClickListener { doShareWallet(true) }
|
||||
btnLoad.setOnClickListener {
|
||||
//if (BuildConfig.DEBUG) {
|
||||
if (true) {
|
||||
|
|
@ -842,9 +836,14 @@ class LoadedWallet : Fragment(), NfcAdapter.ReaderCallback, CardProtocol.Notific
|
|||
|
||||
tvWallet.text = card!!.wallet
|
||||
|
||||
tvBlockchain.text = card!!.blockchainName
|
||||
// tvBlockchain.text = card!!.blockchainName
|
||||
if (card!!.tokenSymbol.length > 1) {
|
||||
val html = Html.fromHtml(card!!.blockchainName)
|
||||
tvBlockchain.text = html
|
||||
} else
|
||||
tvBlockchain.text = card!!.blockchainName
|
||||
|
||||
if (card!!.hasBalanceInfo() && (card!!.balance != 0L) && (card!!.balance != null)) {
|
||||
if (card!!.hasBalanceInfo()) {
|
||||
btnExtract.isEnabled = true
|
||||
btnExtract.backgroundTintList = activeColor
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import android.nfc.Tag
|
|||
import android.os.Bundle
|
||||
import android.support.v4.app.Fragment
|
||||
import android.support.v4.content.ContextCompat
|
||||
import android.text.Html
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
|
|
@ -287,7 +288,13 @@ class VerifyCard : Fragment(), NfcAdapter.ReaderCallback {
|
|||
|
||||
tvIssuer.text = card!!.issuerDescription
|
||||
tvCardRegistredDate.text = card!!.personalizationDateTimeDescription
|
||||
tvBlockchain.text = card!!.blockchainName
|
||||
//tvBlockchain.text = card!!.blockchainName
|
||||
if (card!!.tokenSymbol.length > 1) {
|
||||
val html = Html.fromHtml(card!!.blockchainName)
|
||||
tvBlockchain.text = html
|
||||
} else
|
||||
tvBlockchain.text = card!!.blockchainName
|
||||
|
||||
tvValidationNode.text = card!!.validationNodeDescription
|
||||
|
||||
ivBlockchain.setImageResource(card!!.blockchain.getLogoImageResource(card!!.blockchainID, card!!.tokenSymbol))
|
||||
|
|
|
|||
|
|
@ -84,142 +84,161 @@
|
|||
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/loBalance"
|
||||
<android.support.constraint.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintBottom_toTopOf="@+id/loWallet"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintHeight_min="wrap"
|
||||
app:layout_constraintTop_toBottomOf="@+id/loCard"
|
||||
tools:layout_editor_absoluteX="5dp">
|
||||
app:layout_constraintTop_toBottomOf="@+id/loCard">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/loBalance"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:layout_height="0dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintBottom_toTopOf="@+id/guideline"
|
||||
app:layout_constraintHeight_min="wrap"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_chainStyle="packed">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvBalance"
|
||||
android:layout_width="0dp"
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="3"
|
||||
android:fontFamily="@font/maaxmedium"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/text_size_large"
|
||||
tools:text="0.05 BTC" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvBlockchain"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_weight="1"
|
||||
android:fontFamily="@font/maax"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:gravity="center_vertical"
|
||||
android:textColor="@color/primary"
|
||||
android:textStyle="normal|bold"
|
||||
tools:text="Bitcoin" />
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvBalance"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="3"
|
||||
android:fontFamily="@font/maaxmedium"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/text_size_large"
|
||||
tools:text="0.05 BTC" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvBalanceLine1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="@font/maaxmedium"
|
||||
android:text=" "
|
||||
android:textAlignment="center"
|
||||
android:visibility="visible" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvBalanceLine2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:fontFamily="@font/maax"
|
||||
android:paddingStart="5dp"
|
||||
android:paddingEnd="5dp"
|
||||
android:text=" "
|
||||
android:textAlignment="center"
|
||||
android:visibility="visible" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvBalanceLine1"
|
||||
<android.support.constraint.Guideline
|
||||
android:id="@+id/guideline"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:fontFamily="@font/maaxmedium"
|
||||
android:text=" "
|
||||
android:textAlignment="center"
|
||||
android:visibility="visible" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvBalanceLine2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:fontFamily="@font/maax"
|
||||
android:paddingStart="5dp"
|
||||
android:paddingEnd="5dp"
|
||||
android:text=" "
|
||||
android:textAlignment="center"
|
||||
android:visibility="visible" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/loWallet"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintBottom_toBottomOf="parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/ivQR"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="@dimen/size_qr_image"
|
||||
android:layout_weight="1" />
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintGuide_percent="0.5" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_vertical|center_horizontal"
|
||||
android:orientation="vertical">
|
||||
android:id="@+id/loWallet"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:gravity="top|center"
|
||||
android:orientation="horizontal"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintHeight_min="wrap"
|
||||
app:layout_constraintTop_toBottomOf="@+id/guideline">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvWallet"
|
||||
android:layout_width="match_parent"
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:fontFamily="@font/maax"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="@dimen/text_size_1_small"
|
||||
tools:text="1DoQdnSYshhZ5Tqt5Sk6svZt29jqoYVwQY" />
|
||||
|
||||
<android.support.v7.widget.AppCompatButton
|
||||
android:id="@+id/btnLookup"
|
||||
style="@style/AppTheme.RoundedCornerMaterialButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="34dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:layout_weight="1"
|
||||
android:backgroundTint="@color/white"
|
||||
android:drawableStart="@drawable/ic_explore_black_24dp"
|
||||
android:elevation="15dp"
|
||||
android:fontFamily="@font/saira_condensed_bold"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingRight="20dp"
|
||||
android:text="@string/explore"
|
||||
android:textColor="@color/primary_dark" />
|
||||
android:gravity="center_vertical|center_horizontal"
|
||||
android:orientation="vertical">
|
||||
|
||||
<android.support.v7.widget.AppCompatButton
|
||||
android:id="@+id/btnCopy"
|
||||
style="@style/AppTheme.RoundedCornerMaterialButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="34dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:layout_weight="1"
|
||||
android:backgroundTint="@color/white"
|
||||
android:drawableStart="@drawable/ic_content_copy_black_24dp"
|
||||
android:elevation="15dp"
|
||||
android:fontFamily="@font/saira_condensed_bold"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingRight="20dp"
|
||||
android:text="@string/copy"
|
||||
android:textColor="@color/primary_dark" />
|
||||
<TextView
|
||||
android:id="@+id/tvBlockchain"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:fontFamily="@font/maaxmedium"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@color/primary_dark"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="normal"
|
||||
tools:text="Bitcoin" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvWallet"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="3dp"
|
||||
android:layout_marginRight="3dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:fontFamily="@font/maax"
|
||||
android:textAlignment="center"
|
||||
android:textColor="@android:color/black"
|
||||
android:textSize="@dimen/text_size_1_small"
|
||||
tools:text="1DoQdnSYshhZ5Tqt5Sk6svZt29jqoYVwQY" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<android.support.v7.widget.AppCompatButton
|
||||
android:id="@+id/btnLookup"
|
||||
style="@style/AppTheme.RoundedCornerMaterialButton"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="34dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:layout_weight="1"
|
||||
android:backgroundTint="@color/white"
|
||||
android:drawableStart="@drawable/ic_explore_black_24dp"
|
||||
android:elevation="15dp"
|
||||
android:fontFamily="@font/saira_condensed_bold"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingRight="20dp"
|
||||
android:text="@string/explore"
|
||||
android:textColor="@color/primary_dark" />
|
||||
|
||||
<android.support.v7.widget.AppCompatButton
|
||||
android:id="@+id/btnCopy"
|
||||
style="@style/AppTheme.RoundedCornerMaterialButton"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="34dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:layout_weight="1"
|
||||
android:backgroundTint="@color/white"
|
||||
android:drawableStart="@drawable/ic_content_copy_black_24dp"
|
||||
android:elevation="15dp"
|
||||
android:fontFamily="@font/saira_condensed_bold"
|
||||
android:paddingLeft="20dp"
|
||||
android:paddingRight="20dp"
|
||||
android:text="@string/copy"
|
||||
android:textColor="@color/primary_dark" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</android.support.constraint.ConstraintLayout>
|
||||
|
||||
</android.support.constraint.ConstraintLayout>
|
||||
|
||||
|
|
@ -264,6 +283,13 @@
|
|||
|
||||
</RelativeLayout>
|
||||
|
||||
<View
|
||||
android:id="@+id/vSplitLine2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="@android:color/darker_gray"
|
||||
app:layout_constraintBottom_toTopOf="@+id/rlToolButtons" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/rlToolButtons"
|
||||
android:layout_width="match_parent"
|
||||
|
|
@ -277,8 +303,8 @@
|
|||
style="@style/AppTheme.RoundedCornerMaterialButton"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_weight="1"
|
||||
android:elevation="15dp"
|
||||
android:fontFamily="@font/saira_condensed_bold"
|
||||
|
|
@ -292,8 +318,8 @@
|
|||
style="@style/AppTheme.RoundedCornerMaterialButton"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_weight="1"
|
||||
android:elevation="15dp"
|
||||
android:enabled="false"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue