Updated on 2026-08-14
This commit is contained in:
commit
b690338759
14 changed files with 121 additions and 57 deletions
|
|
@ -59,7 +59,7 @@ public class ConfirmPaymentActivity extends AppCompatActivity implements NfcAdap
|
|||
public boolean balanceRequestSuccess = false;
|
||||
private EditText etWallet;
|
||||
// private TextView tvAmountEquivalent;
|
||||
// private TextView tvFeeEquivalent;
|
||||
private TextView tvFeeEquivalent;
|
||||
public EditText etAmount;
|
||||
public EditText etFee;
|
||||
private ImageView ivCamera;
|
||||
|
|
@ -95,7 +95,7 @@ public class ConfirmPaymentActivity extends AppCompatActivity implements NfcAdap
|
|||
etFee = findViewById(R.id.etFee);
|
||||
// TextView tvBalanceEquivalent = findViewById(R.id.tvBalanceEquivalent);
|
||||
// tvAmountEquivalent = findViewById(R.id.tvAmountEquivalent);
|
||||
// tvFeeEquivalent = findViewById(R.id.tvFeeEquivalent);
|
||||
tvFeeEquivalent = findViewById(R.id.tvFeeEquivalent);
|
||||
ivCamera = findViewById(R.id.ivCamera);
|
||||
rgFee = findViewById(R.id.rgFee);
|
||||
|
||||
|
|
@ -138,21 +138,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
|
||||
|
|
|
|||
|
|
@ -47,12 +47,12 @@ public class SendTransactionActivity extends AppCompatActivity {
|
|||
} else if (mCard.getBlockchain() == Blockchain.Bitcoin || mCard.getBlockchain() == Blockchain.BitcoinTestNet) {
|
||||
String nodeAddress = engine.GetNode(mCard);
|
||||
int nodePort = engine.GetNodePort(mCard);
|
||||
ConnectTask connectTask = new ConnectTask(SendTransactionActivity.this, nodeAddress, nodePort);
|
||||
ConnectTask connectTask = new ConnectTask(SendTransactionActivity.this, nodeAddress, nodePort,3);
|
||||
connectTask.execute(ElectrumRequest.Broadcast(mCard.getWallet(), tx));
|
||||
} else if (mCard.getBlockchain() == Blockchain.BitcoinCash || mCard.getBlockchain() == Blockchain.BitcoinCashTestNet) {
|
||||
String nodeAddress = engine.GetNode(mCard);
|
||||
int nodePort = engine.GetNodePort(mCard);
|
||||
ConnectTask connectTask = new ConnectTask(SendTransactionActivity.this, nodeAddress, nodePort);
|
||||
ConnectTask connectTask = new ConnectTask(SendTransactionActivity.this, nodeAddress, nodePort,3);
|
||||
connectTask.execute(ElectrumRequest.Broadcast(mCard.getWallet(), tx));
|
||||
}
|
||||
|
||||
|
|
@ -70,7 +70,7 @@ public class SendTransactionActivity extends AppCompatActivity {
|
|||
|
||||
public void finishWithError(String Message) {
|
||||
Intent intent = new Intent();
|
||||
intent.putExtra("message", "Failed to send transaction. Try again.");
|
||||
intent.putExtra("message", "Try again. Failed to send transaction (" + Message + ")");
|
||||
setResult(MainActivity.RESULT_CANCELED, intent);
|
||||
finish();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -680,7 +680,7 @@ public class LoadedWallet extends Fragment implements SwipeRefreshLayout.OnRefre
|
|||
tvMessage.setVisibility(View.GONE);
|
||||
} else {
|
||||
if (needResendTX) {
|
||||
tvMessage.setText(R.string.sending_cached_transaction);
|
||||
//tvMessage.setText(R.string.sending_cached_transaction);
|
||||
} else {
|
||||
tvMessage.setText(mCard.getMessage());
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue