Updated on 2026-08-14
This commit is contained in:
parent
4339490ef1
commit
f773ca2b80
8 changed files with 163 additions and 168 deletions
|
|
@ -60,24 +60,24 @@ public class BtcEngine extends CoinEngine {
|
|||
}
|
||||
|
||||
|
||||
// public static String[] GetBitcoinTestNetServiceHosts() {
|
||||
// return new String[]{/*"testnetnode.arihanc.com"*/BitcoinTestNetNode.hsmiths_com.getHost(), BitcoinTestNetNode.qtornado_com.getHost(), BitcoinTestNetNode.bauerj_eu.getHost()};
|
||||
// }
|
||||
//
|
||||
// public static Integer[] GetBitcoinTestNetServicePorts() {
|
||||
// return new Integer[]{/*51001*/BitcoinTestNetNode.hsmiths_com.getPort(), BitcoinTestNetNode.qtornado_com.getPort(), BitcoinTestNetNode.bauerj_eu.getPort()};
|
||||
// }
|
||||
|
||||
|
||||
public static String[] GetBitcoinTestNetServiceHosts() {
|
||||
return new String[]{BitcoinTestNetNode.bauerj_eu.getHost()};
|
||||
return new String[]{/*"testnetnode.arihanc.com"*/BitcoinTestNetNode.hsmiths_com.getHost(), BitcoinTestNetNode.qtornado_com.getHost(), BitcoinTestNetNode.bauerj_eu.getHost()};
|
||||
}
|
||||
|
||||
public static Integer[] GetBitcoinTestNetServicePorts() {
|
||||
return new Integer[]{BitcoinTestNetNode.bauerj_eu.getPort()};
|
||||
return new Integer[]{/*51001*/BitcoinTestNetNode.hsmiths_com.getPort(), BitcoinTestNetNode.qtornado_com.getPort(), BitcoinTestNetNode.bauerj_eu.getPort()};
|
||||
}
|
||||
|
||||
|
||||
// public static String[] GetBitcoinTestNetServiceHosts() {
|
||||
// return new String[]{BitcoinTestNetNode.bauerj_eu.getHost()};
|
||||
// }
|
||||
//
|
||||
// public static Integer[] GetBitcoinTestNetServicePorts() {
|
||||
// return new Integer[]{BitcoinTestNetNode.bauerj_eu.getPort()};
|
||||
// }
|
||||
|
||||
|
||||
|
||||
// public static String[] GetBitcoinTestNetServiceHosts() {
|
||||
// return new String[]{"electrum.akinbo.org"/*, "testnet.hsmiths.com", "testnet.qtornado.com", "testnet1.bauerj.eu"*/};
|
||||
|
|
|
|||
|
|
@ -61,8 +61,8 @@ public class ConfirmPaymentActivity extends AppCompatActivity implements NfcAdap
|
|||
private boolean feeRequestSuccess = false;
|
||||
private boolean balanceRequestSuccess = false;
|
||||
private EditText etWallet;
|
||||
private TextView tvAmountEquivalent;
|
||||
private TextView tvFeeEquivalent;
|
||||
// private TextView tvAmountEquivalent;
|
||||
// private TextView tvFeeEquivalent;
|
||||
private EditText etAmount;
|
||||
private EditText etFee;
|
||||
private ImageView ivCamera;
|
||||
|
|
@ -353,9 +353,9 @@ public class ConfirmPaymentActivity extends AppCompatActivity implements NfcAdap
|
|||
TextView tvCurrency2 = findViewById(R.id.tvCurrency2);
|
||||
etAmount = findViewById(R.id.etAmount);
|
||||
etFee = findViewById(R.id.etFee);
|
||||
TextView tvBalanceEquivalent = findViewById(R.id.tvBalanceEquivalent);
|
||||
tvAmountEquivalent = findViewById(R.id.tvAmountEquivalent);
|
||||
tvFeeEquivalent = findViewById(R.id.tvFeeEquivalent);
|
||||
// TextView tvBalanceEquivalent = findViewById(R.id.tvBalanceEquivalent);
|
||||
// tvAmountEquivalent = findViewById(R.id.tvAmountEquivalent);
|
||||
// tvFeeEquivalent = findViewById(R.id.tvFeeEquivalent);
|
||||
ivCamera = findViewById(R.id.ivCamera);
|
||||
rgFee = findViewById(R.id.rgFee);
|
||||
|
||||
|
|
@ -369,19 +369,19 @@ public class ConfirmPaymentActivity extends AppCompatActivity implements NfcAdap
|
|||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
try {
|
||||
|
||||
CoinEngine engine = CoinEngineFactory.Create(mCard.getBlockchain());
|
||||
tvAmountEquivalent.setText(engine.GetAmountEqualentDescriptor(mCard, etAmount.getText().toString()));
|
||||
if (!mCard.getAmountEquivalentDescriptionAvailable()) {
|
||||
tvAmountEquivalent.setError("Service unavailable");
|
||||
} else {
|
||||
tvAmountEquivalent.setError(null);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
tvAmountEquivalent.setText("");
|
||||
}
|
||||
// try {
|
||||
//
|
||||
// CoinEngine engine = CoinEngineFactory.Create(mCard.getBlockchain());
|
||||
// tvAmountEquivalent.setText(engine.GetAmountEqualentDescriptor(mCard, etAmount.getText().toString()));
|
||||
// if (!mCard.getAmountEquivalentDescriptionAvailable()) {
|
||||
// tvAmountEquivalent.setError("Service unavailable");
|
||||
// } else {
|
||||
// tvAmountEquivalent.setError(null);
|
||||
// }
|
||||
// } catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
// tvAmountEquivalent.setText("");
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -398,21 +398,21 @@ public class ConfirmPaymentActivity extends AppCompatActivity implements NfcAdap
|
|||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
try {
|
||||
|
||||
CoinEngine engine = CoinEngineFactory.Create(mCard.getBlockchain());
|
||||
String eqFee = engine.EvaluteFeeEquivalent(mCard, etFee.getText().toString());
|
||||
tvFeeEquivalent.setText(eqFee);
|
||||
|
||||
if (!mCard.getAmountEquivalentDescriptionAvailable()) {
|
||||
tvFeeEquivalent.setError("Service unavailable");
|
||||
} else {
|
||||
tvFeeEquivalent.setError(null);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
tvFeeEquivalent.setText("");
|
||||
}
|
||||
// try {
|
||||
//
|
||||
// CoinEngine engine = CoinEngineFactory.Create(mCard.getBlockchain());
|
||||
// String eqFee = engine.EvaluteFeeEquivalent(mCard, etFee.getText().toString());
|
||||
// tvFeeEquivalent.setText(eqFee);
|
||||
//
|
||||
// if (!mCard.getAmountEquivalentDescriptionAvailable()) {
|
||||
// tvFeeEquivalent.setError("Service unavailable");
|
||||
// } else {
|
||||
// tvFeeEquivalent.setError(null);
|
||||
// }
|
||||
// } catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
// tvFeeEquivalent.setText("");
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -436,12 +436,12 @@ public class ConfirmPaymentActivity extends AppCompatActivity implements NfcAdap
|
|||
tvCardID.setText(mCard.getCIDDescription());
|
||||
|
||||
//tvBalanceEquivalent.setText(mCard.getBalanceEquivalentDescription());
|
||||
tvBalanceEquivalent.setText(engine.GetBalanceEquivalent(mCard));
|
||||
if (!mCard.getAmountEquivalentDescriptionAvailable()) {
|
||||
tvBalanceEquivalent.setError("Service unavailable");
|
||||
} else {
|
||||
tvBalanceEquivalent.setError(null);
|
||||
}
|
||||
// tvBalanceEquivalent.setText(engine.GetBalanceEquivalent(mCard));
|
||||
// if (!mCard.getAmountEquivalentDescriptionAvailable()) {
|
||||
// tvBalanceEquivalent.setError("Service unavailable");
|
||||
// } else {
|
||||
// tvBalanceEquivalent.setError(null);
|
||||
// }
|
||||
|
||||
etWallet.setText(getIntent().getStringExtra("Wallet"));
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ public class PreparePaymentActivity extends AppCompatActivity implements NfcAdap
|
|||
private static final int REQUEST_CODE_SEND_PAYMENT = 2;
|
||||
private EditText etWallet;
|
||||
private EditText etAmount;
|
||||
private TextView tvAmountEquivalent;
|
||||
// private TextView tvAmountEquivalent;
|
||||
boolean use_mCurrency;
|
||||
private TangemCard mCard;
|
||||
private NfcManager mNfcManager;
|
||||
|
|
@ -59,8 +59,8 @@ public class PreparePaymentActivity extends AppCompatActivity implements NfcAdap
|
|||
TextView tvCurrency = findViewById(R.id.tvCurrency);
|
||||
TextView tvCardId = findViewById(R.id.tvCardID);
|
||||
TextView tvBalance = findViewById(R.id.tvBalance);
|
||||
TextView tvBalanceEquivalent = findViewById(R.id.tvBalanceEquivalent);
|
||||
tvAmountEquivalent = findViewById(R.id.tvAmountEquivalent);
|
||||
// TextView tvBalanceEquivalent = findViewById(R.id.tvBalanceEquivalent);
|
||||
// tvAmountEquivalent = findViewById(R.id.tvAmountEquivalent);
|
||||
|
||||
tvCardId.setText(mCard.getCIDDescription());
|
||||
CoinEngine engine = CoinEngineFactory.Create(mCard.getBlockchain());
|
||||
|
|
@ -72,17 +72,17 @@ public class PreparePaymentActivity extends AppCompatActivity implements NfcAdap
|
|||
tvBalance.setText(engine.GetBalanceWithAlter(mCard));
|
||||
}
|
||||
|
||||
tvBalanceEquivalent.setText(engine.GetBalanceEquivalent(mCard));
|
||||
// tvBalanceEquivalent.setText(engine.GetBalanceEquivalent(mCard));
|
||||
|
||||
if (etAmount != null && mCard.getRemainingSignatures() < 2) {
|
||||
etAmount.setEnabled(false);
|
||||
}
|
||||
|
||||
if (!mCard.getAmountEquivalentDescriptionAvailable()) {
|
||||
tvBalanceEquivalent.setError("Service unavailable");
|
||||
} else {
|
||||
tvBalanceEquivalent.setError(null);
|
||||
}
|
||||
// if (!mCard.getAmountEquivalentDescriptionAvailable()) {
|
||||
// tvBalanceEquivalent.setError("Service unavailable");
|
||||
// } else {
|
||||
// tvBalanceEquivalent.setError(null);
|
||||
// }
|
||||
|
||||
etAmount.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
|
|
@ -92,18 +92,18 @@ public class PreparePaymentActivity extends AppCompatActivity implements NfcAdap
|
|||
|
||||
@Override
|
||||
public void onTextChanged(CharSequence s, int start, int before, int count) {
|
||||
try {
|
||||
CoinEngine engine = CoinEngineFactory.Create(mCard.getBlockchain());
|
||||
tvAmountEquivalent.setText(engine.GetAmountEqualentDescriptor(mCard, etAmount.getText().toString()));
|
||||
if (!mCard.getAmountEquivalentDescriptionAvailable()) {
|
||||
tvAmountEquivalent.setError("Service unavailable");
|
||||
} else {
|
||||
tvAmountEquivalent.setError(null);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
tvAmountEquivalent.setText("");
|
||||
}
|
||||
// try {
|
||||
// CoinEngine engine = CoinEngineFactory.Create(mCard.getBlockchain());
|
||||
// tvAmountEquivalent.setText(engine.GetAmountEqualentDescriptor(mCard, etAmount.getText().toString()));
|
||||
// if (!mCard.getAmountEquivalentDescriptionAvailable()) {
|
||||
// tvAmountEquivalent.setError("Service unavailable");
|
||||
// } else {
|
||||
// tvAmountEquivalent.setError(null);
|
||||
// }
|
||||
// } catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
// tvAmountEquivalent.setText("");
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -19,9 +19,9 @@ import java.util.TimerTask;
|
|||
* Created by dvol on 06.03.2018.
|
||||
*/
|
||||
public class WaitSecurityDelayDialog extends DialogFragment {
|
||||
ProgressBar progressBar;
|
||||
int msTimeout = 60000, msProgress = 0;
|
||||
Timer timer;
|
||||
private ProgressBar progressBar;
|
||||
private int msTimeout = 60000, msProgress = 0;
|
||||
private Timer timer;
|
||||
|
||||
@Override
|
||||
public Dialog onCreateDialog(Bundle savedInstanceState) {
|
||||
|
|
@ -50,7 +50,7 @@ public class WaitSecurityDelayDialog extends DialogFragment {
|
|||
}, 1000, 1000);
|
||||
return new AlertDialog.Builder(getActivity())
|
||||
.setIcon(R.drawable.tangem_logo_small_new)
|
||||
.setTitle("Security delay")
|
||||
.setTitle(R.string.security_delay)
|
||||
.setView(v)
|
||||
.setCancelable(false)
|
||||
.create();
|
||||
|
|
|
|||
|
|
@ -666,6 +666,8 @@ public class LoadedWallet extends Fragment implements SwipeRefreshLayout.OnRefre
|
|||
} else if (engine.AwaitingConfirmation(mCard)) {
|
||||
Toast.makeText(getContext(), R.string.please_wait_while_previous, Toast.LENGTH_LONG).show();
|
||||
return;
|
||||
|
||||
|
||||
} else if (!engine.CheckUnspentTransaction(mCard)) {
|
||||
Toast.makeText(getContext(), R.string.please_wait_for_confirmation, Toast.LENGTH_LONG).show();
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue