Updated on 2026-08-14
This commit is contained in:
parent
90636a0e6a
commit
885be7bd76
2 changed files with 12 additions and 11 deletions
|
|
@ -4,6 +4,7 @@ import android.app.Activity
|
|||
import android.content.*
|
||||
import android.content.Context.CLIPBOARD_SERVICE
|
||||
import android.content.pm.PackageManager
|
||||
import android.content.res.ColorStateList
|
||||
import android.nfc.NfcAdapter
|
||||
import android.nfc.Tag
|
||||
import android.nfc.tech.IsoDep
|
||||
|
|
@ -40,10 +41,8 @@ import kotlinx.android.synthetic.main.fr_loaded_wallet.*
|
|||
import java.util.*
|
||||
|
||||
class LoadedWallet : Fragment(), NfcAdapter.ReaderCallback, CardProtocol.Notifications, SharedPreferences.OnSharedPreferenceChangeListener {
|
||||
|
||||
companion object {
|
||||
val TAG: String = LoadedWallet::class.java.simpleName
|
||||
|
||||
private const val REQUEST_CODE_SEND_PAYMENT = 1
|
||||
private const val REQUEST_CODE_VERIFY_CARD = 4
|
||||
private const val REQUEST_CODE_PURGE = 2
|
||||
|
|
@ -56,14 +55,10 @@ class LoadedWallet : Fragment(), NfcAdapter.ReaderCallback, CardProtocol.Notific
|
|||
|
||||
private var singleToast: Toast? = null
|
||||
private var nfcManager: NfcManager? = null
|
||||
|
||||
private var serverApiHelper: ServerApiHelper? = null
|
||||
|
||||
var card: TangemCard? = null
|
||||
private var lastTag: Tag? = null
|
||||
|
||||
var srlLoadedWallet: SwipeRefreshLayout? = null
|
||||
|
||||
private var lastReadSuccess = true
|
||||
private var verifyCardTask: VerifyCardTask? = null
|
||||
private var requestPIN2Count = 0
|
||||
|
|
@ -71,8 +66,9 @@ class LoadedWallet : Fragment(), NfcAdapter.ReaderCallback, CardProtocol.Notific
|
|||
private var newPIN = ""
|
||||
private var newPIN2 = ""
|
||||
private var cardProtocol: CardProtocol? = null
|
||||
|
||||
private var sp: SharedPreferences? = null
|
||||
private val inactiveColor: ColorStateList by lazy { resources.getColorStateList(R.color.primary) }
|
||||
private val activeColor: ColorStateList by lazy { resources.getColorStateList(R.color.colorAccent) }
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
|
|
@ -110,6 +106,8 @@ class LoadedWallet : Fragment(), NfcAdapter.ReaderCallback, CardProtocol.Notific
|
|||
e.printStackTrace()
|
||||
}
|
||||
|
||||
btnExtract.backgroundTintList = inactiveColor
|
||||
|
||||
updateViews()
|
||||
|
||||
if (!card!!.hasBalanceInfo()) {
|
||||
|
|
@ -512,7 +510,10 @@ class LoadedWallet : Fragment(), NfcAdapter.ReaderCallback, CardProtocol.Notific
|
|||
|
||||
tvBlockchain.text = card!!.blockchainName
|
||||
|
||||
btnExtract!!.isEnabled = card!!.hasBalanceInfo()
|
||||
btnExtract.isEnabled = card!!.hasBalanceInfo()
|
||||
|
||||
if (btnExtract.isEnabled)
|
||||
btnExtract.backgroundTintList = activeColor
|
||||
|
||||
card!!.error = null
|
||||
card!!.message = null
|
||||
|
|
|
|||
|
|
@ -115,8 +115,8 @@
|
|||
<TextView
|
||||
android:id="@+id/tvBlockchain"
|
||||
android:layout_width="0dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_weight="1"
|
||||
android:fontFamily="@font/maax"
|
||||
android:gravity="center_vertical"
|
||||
|
|
@ -334,7 +334,7 @@
|
|||
android:layout_marginTop="5dp"
|
||||
android:layout_weight="1"
|
||||
android:backgroundTint="@color/white"
|
||||
android:drawableLeft="@drawable/ic_settings_black_24dp"
|
||||
android:drawableStart="@drawable/ic_settings_black_24dp"
|
||||
android:elevation="15dp"
|
||||
android:fontFamily="@font/saira_condensed_bold"
|
||||
android:paddingLeft="20dp"
|
||||
|
|
@ -361,7 +361,7 @@
|
|||
android:layout_marginTop="5dp"
|
||||
android:layout_weight="1"
|
||||
android:backgroundTint="@color/white"
|
||||
android:drawableLeft="@drawable/ic_nfc_white_24dp"
|
||||
android:drawableStart="@drawable/ic_nfc_white_24dp"
|
||||
android:elevation="15dp"
|
||||
android:fontFamily="@font/saira_condensed_bold"
|
||||
android:paddingLeft="20dp"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue