Updated on 2026-08-14

This commit is contained in:
Tangem 2019-01-22 14:29:46 +03:00
commit 18f2a40f24
30 changed files with 2059 additions and 121 deletions

View file

@ -5,6 +5,7 @@ import android.app.Activity
import android.content.Context
import android.content.Intent
import android.nfc.NfcAdapter
import android.nfc.NfcManager
import android.nfc.Tag
import android.os.Bundle
import android.support.v7.app.AppCompatActivity
@ -25,6 +26,7 @@ import java.io.IOException
import javax.inject.Inject
class PreparePaymentActivity : AppCompatActivity(), NfcAdapter.ReaderCallback {
companion object {
val TAG: String = PreparePaymentActivity::class.java.simpleName
fun callingIntent(context: Context, ctx: TangemContext): Intent {
@ -34,6 +36,7 @@ class PreparePaymentActivity : AppCompatActivity(), NfcAdapter.ReaderCallback {
}
}
@Inject
internal lateinit var navigator: Navigator
@ -58,7 +61,8 @@ class PreparePaymentActivity : AppCompatActivity(), NfcAdapter.ReaderCallback {
tvBalance.text = html
//TODO - to engine
if (ctx.blockchain == Blockchain.Token && engine.balance.currency != Blockchain.Ethereum.currency) {
if ((ctx.blockchain == Blockchain.Token && engine.balance.currency!=Blockchain.Ethereum.currency) ||
((ctx.blockchain == Blockchain.RootstockToken && engine.balance.currency!=Blockchain.Rootstock.currency))){
rgIncFee!!.visibility = View.INVISIBLE
} else {
rgIncFee!!.visibility = View.VISIBLE

View file

@ -107,7 +107,7 @@ class LoadedWallet : Fragment(), NfcAdapter.ReaderCallback, CardProtocol.Notific
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
if (ctx.blockchain == Blockchain.Token)
if (ctx.blockchain == Blockchain.Token || ctx.blockchain == Blockchain.RootstockToken)
tvBalance.setSingleLine(false)
ivTangemCard.setImageBitmap(App.localStorage.getCardArtworkBitmap(ctx.card))
@ -706,6 +706,8 @@ class LoadedWallet : Fragment(), NfcAdapter.ReaderCallback, CardProtocol.Notific
Blockchain.Token -> "ethereum"
Blockchain.BitcoinCash -> "bitcoin-cash"
Blockchain.Litecoin -> "litecoin"
Blockchain.Rootstock -> "bitcoin"
Blockchain.RootstockToken ->"bitcoin"
else -> {
throw Exception("Can''t get rate for blockchain " + ctx.blockchainName)
}