diff --git a/.idea/caches/build_file_checksums.ser b/.idea/caches/build_file_checksums.ser index c5e3043e28..c2cb80cab6 100644 Binary files a/.idea/caches/build_file_checksums.ser and b/.idea/caches/build_file_checksums.ser differ diff --git a/.idea/misc.xml b/.idea/misc.xml index c0f68eddd7..7bfef59df1 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,30 +1,5 @@ - - - - diff --git a/app/src/main/java/com/tangem/domain/wallet/BalanceValidator.java b/app/src/main/java/com/tangem/domain/wallet/BalanceValidator.java index 0ef65ff1c9..5a5c01e28c 100644 --- a/app/src/main/java/com/tangem/domain/wallet/BalanceValidator.java +++ b/app/src/main/java/com/tangem/domain/wallet/BalanceValidator.java @@ -1,13 +1,7 @@ package com.tangem.domain.wallet; -import android.graphics.Color; -import android.support.v4.content.ContextCompat; -import android.util.Pair; - import com.tangem.wallet.R; -import java.util.Objects; - public class BalanceValidator { private String firstLine; private String secondLine; @@ -34,7 +28,7 @@ public class BalanceValidator { public void Check(TangemCard card) { - firstLine = ""; + firstLine = "Verification failed"; secondLine = ""; // rule 1 @@ -54,7 +48,7 @@ public class BalanceValidator { // rule 2.c - if(!CheckAttestationServiceResult(card)) { + if(!CheckAttestationServiceResult(card) && CheckAttestationServiceAvailable(card)) { score = 0; firstLine = "Not genuine banknote"; secondLine = "Tangem Attestation service says the banknote is not genuine."; @@ -75,7 +69,7 @@ public class BalanceValidator { if(card.getFailedBalanceRequestCounter()!=0) { score -= 5 * card.getFailedBalanceRequestCounter(); - secondLine += "Not all nodes have returned balance. Swipe down to refresh. "; + secondLine += "Not all nodes have returned balance. Swipe down or tap again. "; if(score <= 0) return; } diff --git a/app/src/main/java/com/tangem/presentation/fragment/LoadedWallet.java b/app/src/main/java/com/tangem/presentation/fragment/LoadedWallet.java index 2c1f654182..ad0c0f72a8 100644 --- a/app/src/main/java/com/tangem/presentation/fragment/LoadedWallet.java +++ b/app/src/main/java/com/tangem/presentation/fragment/LoadedWallet.java @@ -103,7 +103,7 @@ public class LoadedWallet extends Fragment implements SwipeRefreshLayout.OnRefre private Timer timerHideErrorAndMessage = null; private String newPIN = "", newPIN2 = ""; private CardProtocol mCardProtocol; - private int scanTimes = 0; +// private int scanTimes = 0; OnlineVerifyTask onlineVerifyTask; public LoadedWallet() { @@ -258,7 +258,7 @@ public class LoadedWallet extends Fragment implements SwipeRefreshLayout.OnRefre if (mCardProtocol != null) openVerifyCard(mCardProtocol); else { - scanTimes++; +// scanTimes++; Toast.makeText(getContext(), R.string.need_attach_card_again, Toast.LENGTH_LONG).show(); } }); @@ -512,8 +512,13 @@ public class LoadedWallet extends Fragment implements SwipeRefreshLayout.OnRefre CoinEngine engine = CoinEngineFactory.Create(mCard.getBlockchain()); + if ( (mCard.isOnlineVerified()==null || !mCard.isOnlineVerified()) && onlineVerifyTask ==null) { + onlineVerifyTask = new OnlineVerifyTask(); +// updateTasks.add(onlineVerifyTask); + onlineVerifyTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, VerificationServerProtocol.Verify.prepare(mCard)); + } + if (mCard.getBlockchain() == Blockchain.Bitcoin || mCard.getBlockchain() == Blockchain.BitcoinTestNet) { - mCard.resetFailedBalanceRequestCounter(); SharedData data = new SharedData(SharedData.COUNT_REQUEST); mCard.resetFailedBalanceRequestCounter(); mCard.setIsBalanceEqual(true); @@ -638,11 +643,12 @@ public class LoadedWallet extends Fragment implements SwipeRefreshLayout.OnRefre mCardProtocol = cardProtocol; // Log.i(TAG, "scanTimes " + scanTimes); - if (scanTimes > 0) - openVerifyCard(mCardProtocol); +// if (scanTimes > 0) +// openVerifyCard(mCardProtocol); - scanTimes++; +// scanTimes++; + onRefresh(); //addCard(cardProtocol.getCard()); }); diff --git a/app/src/main/res/drawable/card_btc_hk_s.png b/app/src/main/res/drawable/card_btc_hk_s.png index fb5c712622..6f84e90961 100644 Binary files a/app/src/main/res/drawable/card_btc_hk_s.png and b/app/src/main/res/drawable/card_btc_hk_s.png differ