Updated on 2026-08-14
This commit is contained in:
parent
ec01bdcffe
commit
4221fa91ff
3 changed files with 26 additions and 11 deletions
|
|
@ -8,6 +8,7 @@ import android.graphics.Color
|
|||
import android.nfc.NfcAdapter
|
||||
import android.nfc.Tag
|
||||
import android.nfc.tech.IsoDep
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import android.text.Html
|
||||
|
|
@ -69,7 +70,10 @@ class EmptyWalletActivity : AppCompatActivity(), NfcAdapter.ReaderCallback, Card
|
|||
tvIssuer.text = ctx.card!!.issuerDescription
|
||||
|
||||
if (ctx.card!!.tokenSymbol.length > 1) {
|
||||
val html = Html.fromHtml(ctx.blockchainName)
|
||||
@Suppress("DEPRECATION") val html = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
|
||||
Html.fromHtml(ctx.blockchainName, Html.FROM_HTML_MODE_LEGACY)
|
||||
else
|
||||
Html.fromHtml(ctx.blockchainName)
|
||||
tvBlockchain.text = html
|
||||
} else
|
||||
tvBlockchain.text = ctx.blockchainName
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ class MainActivity : AppCompatActivity(), NfcAdapter.ReaderCallback, CardProtoco
|
|||
|
||||
// set phone name
|
||||
if (antenna.fullName != "")
|
||||
tvNFCHint.text = String.format(getString(R.string.scan_banknote), antenna!!.fullName)
|
||||
tvNFCHint.text = String.format(getString(R.string.scan_banknote), antenna.fullName)
|
||||
else
|
||||
tvNFCHint.text = String.format(getString(R.string.scan_banknote), getString(R.string.phone))
|
||||
|
||||
|
|
@ -309,7 +309,7 @@ class MainActivity : AppCompatActivity(), NfcAdapter.ReaderCallback, CardProtoco
|
|||
|
||||
val uid = cardInfo.getString("UID")
|
||||
val card = TangemCard(uid)
|
||||
card.loadFromBundle(cardInfo.getBundle("Card"))
|
||||
cardInfo.getBundle("Card")?.let { card.loadFromBundle(it) }
|
||||
|
||||
val ctx = TangemContext(card)
|
||||
when {
|
||||
|
|
@ -317,8 +317,6 @@ class MainActivity : AppCompatActivity(), NfcAdapter.ReaderCallback, CardProtoco
|
|||
val engineCoin = CoinEngineFactory.create(ctx)
|
||||
?: throw CardProtocol.TangemException("Can't create CoinEngine!")
|
||||
engineCoin.defineWallet()
|
||||
//mCard.setWallet(Blockchain.calculateWalletAddress(mCard, pkUncompressed));
|
||||
|
||||
navigator.showLoadedWallet(this, it, ctx)
|
||||
}
|
||||
card.status == TangemCard.Status.Empty -> navigator.showEmptyWallet(this, ctx)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue