Updated on 2026-08-14
This commit is contained in:
parent
2922eab134
commit
cfebd18d17
10 changed files with 33 additions and 38 deletions
|
|
@ -15,7 +15,7 @@ android {
|
|||
applicationId "com.tangem.wallet"
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 28
|
||||
versionCode 101
|
||||
versionCode 102
|
||||
versionName "0.811.1." + generateVersionName()
|
||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
|
@ -60,7 +60,7 @@ dependencies {
|
|||
implementation 'com.scottyab:rootbeer-lib:0.0.7'
|
||||
implementation 'com.squareup.retrofit2:converter-gson:2.5.0'
|
||||
implementation 'com.squareup.retrofit2:retrofit:2.5.0'
|
||||
implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0'
|
||||
implementation 'com.squareup.okhttp3:logging-interceptor:3.11.0'
|
||||
implementation 'com.skyfishjy.ripplebackground:library:1.0.1'
|
||||
implementation 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0'
|
||||
implementation 'com.google.dagger:dagger:2.16'
|
||||
|
|
|
|||
|
|
@ -38,7 +38,6 @@ class Navigator {
|
|||
|
||||
fun showPinSwap(context: Activity, newPIN: String, newPIN2: String) {
|
||||
context.startActivityForResult(PinSwapActivity.callingIntent(context, newPIN, newPIN2), Constant.REQUEST_CODE_SWAP_PIN)
|
||||
|
||||
}
|
||||
|
||||
fun showPurge(context: Activity) {
|
||||
|
|
|
|||
|
|
@ -194,7 +194,7 @@ class CreateNewWalletActivity : AppCompatActivity(), NfcAdapter.ReaderCallback,
|
|||
}
|
||||
|
||||
override fun onReadWait(msec: Int) {
|
||||
WaitSecurityDelayDialog.OnReadWait(this, msec)
|
||||
WaitSecurityDelayDialog.onReadWait(this, msec)
|
||||
}
|
||||
|
||||
override fun onReadBeforeRequest(timeout: Int) {
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@ import android.text.Html
|
|||
import android.view.View
|
||||
import android.widget.Toast
|
||||
import com.tangem.App
|
||||
import com.tangem.di.Navigator
|
||||
import com.tangem.tangemcard.tasks.VerifyCardTask
|
||||
import com.tangem.tangemcard.reader.CardProtocol
|
||||
import com.tangem.tangemcard.android.reader.NfcManager
|
||||
|
|
@ -253,7 +252,7 @@ class EmptyWalletActivity : AppCompatActivity(), NfcAdapter.ReaderCallback, Card
|
|||
}
|
||||
|
||||
override fun onReadWait(msec: Int) {
|
||||
WaitSecurityDelayDialog.OnReadWait(this, msec)
|
||||
WaitSecurityDelayDialog.onReadWait(this, msec)
|
||||
}
|
||||
|
||||
override fun onReadBeforeRequest(timeout: Int) {
|
||||
|
|
|
|||
|
|
@ -385,7 +385,7 @@ class MainActivity : AppCompatActivity(), NfcAdapter.ReaderCallback, CardProtoco
|
|||
}
|
||||
|
||||
override fun onReadWait(msec: Int) {
|
||||
WaitSecurityDelayDialog.OnReadWait(Objects.requireNonNull(this), msec)
|
||||
WaitSecurityDelayDialog.onReadWait(Objects.requireNonNull(this), msec)
|
||||
}
|
||||
|
||||
override fun onReadBeforeRequest(timeout: Int) {
|
||||
|
|
|
|||
|
|
@ -201,7 +201,7 @@ class PinSwapActivity : AppCompatActivity(), NfcAdapter.ReaderCallback, CardProt
|
|||
}
|
||||
|
||||
override fun onReadWait(msec: Int) {
|
||||
WaitSecurityDelayDialog.OnReadWait(this, msec)
|
||||
WaitSecurityDelayDialog.onReadWait(this, msec)
|
||||
}
|
||||
|
||||
override fun onReadBeforeRequest(timeout: Int) {
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ class PurgeActivity : AppCompatActivity(), NfcAdapter.ReaderCallback, CardProtoc
|
|||
}
|
||||
|
||||
override fun onReadWait(msec: Int) {
|
||||
WaitSecurityDelayDialog.OnReadWait(this, msec)
|
||||
WaitSecurityDelayDialog.onReadWait(this, msec)
|
||||
}
|
||||
|
||||
override fun onReadBeforeRequest(timeout: Int) {
|
||||
|
|
|
|||
|
|
@ -14,13 +14,11 @@ import android.view.View
|
|||
import android.widget.ProgressBar
|
||||
import android.widget.Toast
|
||||
import com.tangem.App
|
||||
import com.tangem.domain.wallet.BTCUtils
|
||||
import com.tangem.domain.wallet.CoinEngine
|
||||
import com.tangem.domain.wallet.CoinEngineFactory
|
||||
import com.tangem.domain.wallet.TangemContext
|
||||
import com.tangem.presentation.dialog.NoExtendedLengthSupportDialog
|
||||
import com.tangem.presentation.dialog.WaitSecurityDelayDialog
|
||||
import com.tangem.data.Blockchain
|
||||
import com.tangem.tangemcard.reader.CardProtocol
|
||||
import com.tangem.tangemcard.android.reader.NfcManager
|
||||
import com.tangem.tangemcard.android.reader.NfcReader
|
||||
|
|
@ -272,7 +270,7 @@ class SignPaymentActivity : AppCompatActivity(), NfcAdapter.ReaderCallback, Card
|
|||
}
|
||||
|
||||
override fun onReadWait(msec: Int) {
|
||||
WaitSecurityDelayDialog.OnReadWait(this, msec)
|
||||
WaitSecurityDelayDialog.onReadWait(this, msec)
|
||||
}
|
||||
|
||||
override fun onReadBeforeRequest(timeout: Int) {
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@ public class WaitSecurityDelayDialog extends DialogFragment {
|
|||
});
|
||||
}
|
||||
|
||||
public static void OnReadWait(final Activity activity, final int msec) {
|
||||
public static void onReadWait(final Activity activity, final int msec) {
|
||||
activity.runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
|
|
|||
|
|
@ -73,11 +73,10 @@ class LoadedWallet : Fragment(), NfcAdapter.ReaderCallback, CardProtocol.Notific
|
|||
private val inactiveColor: ColorStateList by lazy { resources.getColorStateList(R.color.btn_dark) }
|
||||
private val activeColor: ColorStateList by lazy { resources.getColorStateList(R.color.colorAccent) }
|
||||
private var requestCounter: Int = 0
|
||||
set(value)
|
||||
{
|
||||
field=value
|
||||
set(value) {
|
||||
field = value
|
||||
Log.i(TAG, "requestCounter, set $field")
|
||||
if (field <= 0 && srl!=null && srl.isRefreshing ) {
|
||||
if (field <= 0 && srl != null && srl.isRefreshing) {
|
||||
Log.e(TAG, "+++++++++++ FINISH REFRESH")
|
||||
if (srl != null) srl!!.isRefreshing = false
|
||||
//updateViews()
|
||||
|
|
@ -198,9 +197,10 @@ class LoadedWallet : Fragment(), NfcAdapter.ReaderCallback, CardProtocol.Notific
|
|||
else if (ctx.card!!.remainingSignatures == 0)
|
||||
showSingleToast(R.string.card_has_no_remaining_signature)
|
||||
else {
|
||||
val intent = Intent(activity, PreparePaymentActivity::class.java)
|
||||
ctx.saveToIntent(intent)
|
||||
startActivityForResult(intent, Constant.REQUEST_CODE_SEND_PAYMENT)
|
||||
(activity as LoadedWalletActivity).navigator.showPreparePayment(context as Activity, ctx)
|
||||
// val intent = Intent(activity, PreparePaymentActivity::class.java)
|
||||
// ctx.saveToIntent(intent)
|
||||
// startActivityForResult(intent, Constant.REQUEST_CODE_SEND_PAYMENT)
|
||||
}
|
||||
} else
|
||||
Toast.makeText(activity, getString(R.string.no_connection), Toast.LENGTH_SHORT).show()
|
||||
|
|
@ -404,8 +404,8 @@ class LoadedWallet : Fragment(), NfcAdapter.ReaderCallback, CardProtocol.Notific
|
|||
// request card verify and get info listener
|
||||
val cardVerifyAndGetInfoListener: ServerApiTangem.CardVerifyAndGetInfoListener = object : ServerApiTangem.CardVerifyAndGetInfoListener {
|
||||
override fun onSuccess(cardVerifyAndGetArtworkResponse: CardVerifyAndGetInfo.Response?) {
|
||||
Log.i(TAG,"cardVerifyAndGetInfoListener onSuccess")
|
||||
if( activity==null || !UtilHelper.isOnline(activity!!)) return
|
||||
Log.i(TAG, "cardVerifyAndGetInfoListener onSuccess")
|
||||
if (activity == null || !UtilHelper.isOnline(activity!!)) return
|
||||
|
||||
val result = cardVerifyAndGetArtworkResponse?.results!![0]
|
||||
if (result.error != null) {
|
||||
|
|
@ -437,8 +437,8 @@ class LoadedWallet : Fragment(), NfcAdapter.ReaderCallback, CardProtocol.Notific
|
|||
}
|
||||
|
||||
override fun onFail(message: String?) {
|
||||
Log.i(TAG,"cardVerifyAndGetInfoListener onFail")
|
||||
if( activity==null || !UtilHelper.isOnline(activity!!)) return
|
||||
Log.i(TAG, "cardVerifyAndGetInfoListener onFail")
|
||||
if (activity == null || !UtilHelper.isOnline(activity!!)) return
|
||||
requestCounter--
|
||||
updateViews()
|
||||
}
|
||||
|
|
@ -448,8 +448,8 @@ class LoadedWallet : Fragment(), NfcAdapter.ReaderCallback, CardProtocol.Notific
|
|||
// request artwork listener
|
||||
val artworkListener: ServerApiTangem.ArtworkListener = object : ServerApiTangem.ArtworkListener {
|
||||
override fun onSuccess(artworkId: String?, inputStream: InputStream?, updateDate: Date?) {
|
||||
Log.i(TAG,"artworkListener onSuccess")
|
||||
if( activity==null || !UtilHelper.isOnline(activity!!)) return
|
||||
Log.i(TAG, "artworkListener onSuccess")
|
||||
if (activity == null || !UtilHelper.isOnline(activity!!)) return
|
||||
App.localStorage.updateArtwork(artworkId!!, inputStream!!, updateDate!!)
|
||||
requestCounter--
|
||||
ivTangemCard.setImageBitmap(App.localStorage.getCardArtworkBitmap(ctx.card!!))
|
||||
|
|
@ -457,8 +457,8 @@ class LoadedWallet : Fragment(), NfcAdapter.ReaderCallback, CardProtocol.Notific
|
|||
}
|
||||
|
||||
override fun onFail(message: String?) {
|
||||
Log.i(TAG,"artworkListener onFail")
|
||||
if( activity==null || !UtilHelper.isOnline(activity!!)) return
|
||||
Log.i(TAG, "artworkListener onFail")
|
||||
if (activity == null || !UtilHelper.isOnline(activity!!)) return
|
||||
requestCounter--
|
||||
updateViews()
|
||||
}
|
||||
|
|
@ -467,7 +467,7 @@ class LoadedWallet : Fragment(), NfcAdapter.ReaderCallback, CardProtocol.Notific
|
|||
|
||||
// request rate info listener
|
||||
serverApiCommon.setRateInfoData {
|
||||
if( activity==null || !UtilHelper.isOnline(activity!!)) return@setRateInfoData
|
||||
if (activity == null || !UtilHelper.isOnline(activity!!)) return@setRateInfoData
|
||||
val rate = it.priceUsd.toFloat()
|
||||
ctx.coinData!!.rate = rate
|
||||
ctx.coinData!!.rateAlter = rate
|
||||
|
|
@ -709,7 +709,7 @@ class LoadedWallet : Fragment(), NfcAdapter.ReaderCallback, CardProtocol.Notific
|
|||
}
|
||||
|
||||
override fun onReadWait(msec: Int) {
|
||||
WaitSecurityDelayDialog.OnReadWait(activity, msec)
|
||||
WaitSecurityDelayDialog.onReadWait(activity, msec)
|
||||
}
|
||||
|
||||
override fun onReadBeforeRequest(timeout: Int) {
|
||||
|
|
@ -725,7 +725,7 @@ class LoadedWallet : Fragment(), NfcAdapter.ReaderCallback, CardProtocol.Notific
|
|||
}
|
||||
|
||||
fun updateViews() {
|
||||
if( activity==null || !UtilHelper.isOnline(activity!!)) return
|
||||
if (activity == null || !UtilHelper.isOnline(activity!!)) return
|
||||
|
||||
if (timerHideErrorAndMessage != null) {
|
||||
timerHideErrorAndMessage!!.cancel()
|
||||
|
|
@ -785,7 +785,7 @@ class LoadedWallet : Fragment(), NfcAdapter.ReaderCallback, CardProtocol.Notific
|
|||
} else
|
||||
tvBlockchain.text = ctx.blockchainName
|
||||
|
||||
if (requestCounter==0 && engine.hasBalanceInfo()) {
|
||||
if (requestCounter == 0 && engine.hasBalanceInfo()) {
|
||||
btnExtract.isEnabled = true
|
||||
btnExtract.backgroundTintList = activeColor
|
||||
} else {
|
||||
|
|
@ -819,18 +819,17 @@ class LoadedWallet : Fragment(), NfcAdapter.ReaderCallback, CardProtocol.Notific
|
|||
coinEngine!!.requestBalanceAndUnspentTransactions(
|
||||
object : CoinEngine.BlockchainRequestsCallbacks {
|
||||
override fun onComplete(success: Boolean) {
|
||||
Log.i(TAG, "requestBalanceAndUnspentTransactions onComplete: "+success.toString()+", request counter "+requestCounter.toString())
|
||||
if( activity==null || !UtilHelper.isOnline(activity!!)) return
|
||||
Log.i(TAG, "requestBalanceAndUnspentTransactions onComplete: " + success.toString() + ", request counter " + requestCounter.toString())
|
||||
if (activity == null || !UtilHelper.isOnline(activity!!)) return
|
||||
requestCounter--
|
||||
if(! success)
|
||||
{
|
||||
Log.e(TAG, "ctx.error: "+ctx.error)
|
||||
if (!success) {
|
||||
Log.e(TAG, "ctx.error: " + ctx.error)
|
||||
}
|
||||
updateViews()
|
||||
}
|
||||
|
||||
override fun onProgress() {
|
||||
if( activity==null || !UtilHelper.isOnline(activity!!)) return
|
||||
if (activity == null || !UtilHelper.isOnline(activity!!)) return
|
||||
Log.i(TAG, "requestBalanceAndUnspentTransactions onProgress")
|
||||
updateViews()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue