hide sweep amount in street mode (#526)

This commit is contained in:
m2049r 2019-01-28 01:16:00 +01:00 committed by GitHub
parent 39d048fd5e
commit 0d213a1eb4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
22 changed files with 59 additions and 5 deletions

View File

@ -214,11 +214,16 @@ public class SendConfirmWizardFragment extends SendWizardFragment implements Sen
if (pendingTransaction != null) { if (pendingTransaction != null) {
llConfirmSend.setVisibility(View.VISIBLE); llConfirmSend.setVisibility(View.VISIBLE);
bSend.setEnabled(true); bSend.setEnabled(true);
tvTxAmount.setText(Wallet.getDisplayAmount(pendingTransaction.getAmount()));
tvTxFee.setText(Wallet.getDisplayAmount(pendingTransaction.getFee())); tvTxFee.setText(Wallet.getDisplayAmount(pendingTransaction.getFee()));
//tvTxDust.setText(Wallet.getDisplayAmount(pendingTransaction.getDust())); if (getActivityCallback().isStreetMode()
tvTxTotal.setText(Wallet.getDisplayAmount( && (sendListener.getTxData().getAmount() == Wallet.SWEEP_ALL)) {
pendingTransaction.getFee() + pendingTransaction.getAmount())); tvTxAmount.setText(getString(R.string.street_sweep_amount));
tvTxTotal.setText(getString(R.string.street_sweep_amount));
} else {
tvTxAmount.setText(Wallet.getDisplayAmount(pendingTransaction.getAmount()));
tvTxTotal.setText(Wallet.getDisplayAmount(
pendingTransaction.getFee() + pendingTransaction.getAmount()));
}
} else { } else {
llConfirmSend.setVisibility(View.GONE); llConfirmSend.setVisibility(View.GONE);
bSend.setEnabled(false); bSend.setEnabled(false);

View File

@ -27,6 +27,7 @@ import android.widget.Toast;
import com.m2049r.xmrwallet.R; import com.m2049r.xmrwallet.R;
import com.m2049r.xmrwallet.data.PendingTx; import com.m2049r.xmrwallet.data.PendingTx;
import com.m2049r.xmrwallet.data.TxData; import com.m2049r.xmrwallet.data.TxData;
import com.m2049r.xmrwallet.model.Wallet;
import com.m2049r.xmrwallet.util.Helper; import com.m2049r.xmrwallet.util.Helper;
import timber.log.Timber; import timber.log.Timber;
@ -54,6 +55,8 @@ public class SendSuccessWizardFragment extends SendWizardFragment {
void enableDone(); void enableDone();
SendFragment.Mode getMode(); SendFragment.Mode getMode();
SendFragment.Listener getActivityCallback();
} }
ImageButton bCopyTxId; ImageButton bCopyTxId;
@ -120,7 +123,13 @@ public class SendSuccessWizardFragment extends SendWizardFragment {
tvTxId.setText(committedTx.txId); tvTxId.setText(committedTx.txId);
bCopyTxId.setEnabled(true); bCopyTxId.setEnabled(true);
bCopyTxId.setImageResource(R.drawable.ic_content_copy_black_24dp); bCopyTxId.setImageResource(R.drawable.ic_content_copy_black_24dp);
tvTxAmount.setText(getString(R.string.send_amount, Helper.getDisplayAmount(committedTx.amount)));
if (sendListener.getActivityCallback().isStreetMode()
&& (sendListener.getTxData().getAmount() == Wallet.SWEEP_ALL)) {
tvTxAmount.setText(getString(R.string.street_sweep_amount));
} else {
tvTxAmount.setText(getString(R.string.send_amount, Helper.getDisplayAmount(committedTx.amount)));
}
tvTxFee.setText(getString(R.string.send_fee, Helper.getDisplayAmount(committedTx.fee))); tvTxFee.setText(getString(R.string.send_fee, Helper.getDisplayAmount(committedTx.fee)));
} }
sendListener.enableDone(); sendListener.enableDone();

View File

@ -374,4 +374,6 @@
<string name="xmrto_error_004">BTC amount out of bounds</string> <string name="xmrto_error_004">BTC amount out of bounds</string>
<string name="xmrto_error_010">Invalid or outdated Payment URL</string> <string name="xmrto_error_010">Invalid or outdated Payment URL</string>
<string name="xmrto_error_012">Too many requests</string> <string name="xmrto_error_012">Too many requests</string>
<string name="street_sweep_amount">EVERYTHING!</string> <!-- as in: "everything in the account" = "all the money" -->
</resources> </resources>

View File

@ -373,4 +373,6 @@
<string name="xmrto_error_004">BTC amount out of bounds</string> <string name="xmrto_error_004">BTC amount out of bounds</string>
<string name="xmrto_error_010">Invalid or outdated Payment URL</string> <string name="xmrto_error_010">Invalid or outdated Payment URL</string>
<string name="xmrto_error_012">Too many requests</string> <string name="xmrto_error_012">Too many requests</string>
<string name="street_sweep_amount">EVERYTHING!</string> <!-- as in: "everything in the account" = "all the money" -->
</resources> </resources>

View File

@ -363,4 +363,6 @@
<string name="xmrto_error_004">BTC amount out of bounds</string> <string name="xmrto_error_004">BTC amount out of bounds</string>
<string name="xmrto_error_010">Invalid or outdated Payment URL</string> <string name="xmrto_error_010">Invalid or outdated Payment URL</string>
<string name="xmrto_error_012">Too many requests</string> <string name="xmrto_error_012">Too many requests</string>
<string name="street_sweep_amount">EVERYTHING!</string> <!-- as in: "everything in the account" = "all the money" -->
</resources> </resources>

View File

@ -371,4 +371,6 @@
<string name="xmrto_error_004">BTC amount out of bounds</string> <string name="xmrto_error_004">BTC amount out of bounds</string>
<string name="xmrto_error_010">Invalid or outdated Payment URL</string> <string name="xmrto_error_010">Invalid or outdated Payment URL</string>
<string name="xmrto_error_012">Too many requests</string> <string name="xmrto_error_012">Too many requests</string>
<string name="street_sweep_amount">EVERYTHING!</string> <!-- as in: "everything in the account" = "all the money" -->
</resources> </resources>

View File

@ -377,4 +377,6 @@
<string name="xmrto_error_004">BTC amount out of bounds</string> <string name="xmrto_error_004">BTC amount out of bounds</string>
<string name="xmrto_error_010">Invalid or outdated Payment URL</string> <string name="xmrto_error_010">Invalid or outdated Payment URL</string>
<string name="xmrto_error_012">Too many requests</string> <string name="xmrto_error_012">Too many requests</string>
<string name="street_sweep_amount">EVERYTHING!</string> <!-- as in: "everything in the account" = "all the money" -->
</resources> </resources>

View File

@ -375,4 +375,6 @@
<string name="xmrto_error_004">BTC amount out of bounds</string> <string name="xmrto_error_004">BTC amount out of bounds</string>
<string name="xmrto_error_010">Invalid or outdated Payment URL</string> <string name="xmrto_error_010">Invalid or outdated Payment URL</string>
<string name="xmrto_error_012">Too many requests</string> <string name="xmrto_error_012">Too many requests</string>
<string name="street_sweep_amount">EVERYTHING!</string> <!-- as in: "everything in the account" = "all the money" -->
</resources> </resources>

View File

@ -376,4 +376,6 @@
<string name="xmrto_error_004">BTC amount out of bounds</string> <string name="xmrto_error_004">BTC amount out of bounds</string>
<string name="xmrto_error_010">Invalid or outdated Payment URL</string> <string name="xmrto_error_010">Invalid or outdated Payment URL</string>
<string name="xmrto_error_012">Too many requests</string> <string name="xmrto_error_012">Too many requests</string>
<string name="street_sweep_amount">EVERYTHING!</string> <!-- as in: "everything in the account" = "all the money" -->
</resources> </resources>

View File

@ -419,4 +419,6 @@
<string name="xmrto_error_004">BTC amount out of bounds</string> <string name="xmrto_error_004">BTC amount out of bounds</string>
<string name="xmrto_error_010">Invalid or outdated Payment URL</string> <string name="xmrto_error_010">Invalid or outdated Payment URL</string>
<string name="xmrto_error_012">Too many requests</string> <string name="xmrto_error_012">Too many requests</string>
<string name="street_sweep_amount">EVERYTHING!</string> <!-- as in: "everything in the account" = "all the money" -->
</resources> </resources>

View File

@ -373,4 +373,6 @@
<string name="xmrto_error_004">BTC amount out of bounds</string> <string name="xmrto_error_004">BTC amount out of bounds</string>
<string name="xmrto_error_010">Invalid or outdated Payment URL</string> <string name="xmrto_error_010">Invalid or outdated Payment URL</string>
<string name="xmrto_error_012">Too many requests</string> <string name="xmrto_error_012">Too many requests</string>
<string name="street_sweep_amount">EVERYTHING!</string> <!-- as in: "everything in the account" = "all the money" -->
</resources> </resources>

View File

@ -373,4 +373,6 @@
<string name="xmrto_error_004">BTC amount out of bounds</string> <string name="xmrto_error_004">BTC amount out of bounds</string>
<string name="xmrto_error_010">Invalid or outdated Payment URL</string> <string name="xmrto_error_010">Invalid or outdated Payment URL</string>
<string name="xmrto_error_012">Too many requests</string> <string name="xmrto_error_012">Too many requests</string>
<string name="street_sweep_amount">EVERYTHING!</string> <!-- as in: "everything in the account" = "all the money" -->
</resources> </resources>

View File

@ -365,4 +365,6 @@
<string name="xmrto_error_004">BTC amount out of bounds</string> <string name="xmrto_error_004">BTC amount out of bounds</string>
<string name="xmrto_error_010">Invalid or outdated Payment URL</string> <string name="xmrto_error_010">Invalid or outdated Payment URL</string>
<string name="xmrto_error_012">Too many requests</string> <string name="xmrto_error_012">Too many requests</string>
<string name="street_sweep_amount">EVERYTHING!</string> <!-- as in: "everything in the account" = "all the money" -->
</resources> </resources>

View File

@ -377,4 +377,6 @@
<string name="xmrto_error_004">BTC amount out of bounds</string> <string name="xmrto_error_004">BTC amount out of bounds</string>
<string name="xmrto_error_010">Invalid or outdated Payment URL</string> <string name="xmrto_error_010">Invalid or outdated Payment URL</string>
<string name="xmrto_error_012">Too many requests</string> <string name="xmrto_error_012">Too many requests</string>
<string name="street_sweep_amount">EVERYTHING!</string> <!-- as in: "everything in the account" = "all the money" -->
</resources> </resources>

View File

@ -373,4 +373,6 @@
<string name="xmrto_error_004">BTC amount out of bounds</string> <string name="xmrto_error_004">BTC amount out of bounds</string>
<string name="xmrto_error_010">Invalid or outdated Payment URL</string> <string name="xmrto_error_010">Invalid or outdated Payment URL</string>
<string name="xmrto_error_012">Too many requests</string> <string name="xmrto_error_012">Too many requests</string>
<string name="street_sweep_amount">EVERYTHING!</string> <!-- as in: "everything in the account" = "all the money" -->
</resources> </resources>

View File

@ -377,4 +377,6 @@
<string name="xmrto_error_004">BTC amount out of bounds</string> <string name="xmrto_error_004">BTC amount out of bounds</string>
<string name="xmrto_error_010">Invalid or outdated Payment URL</string> <string name="xmrto_error_010">Invalid or outdated Payment URL</string>
<string name="xmrto_error_012">Too many requests</string> <string name="xmrto_error_012">Too many requests</string>
<string name="street_sweep_amount">EVERYTHING!</string> <!-- as in: "everything in the account" = "all the money" -->
</resources> </resources>

View File

@ -374,4 +374,6 @@
<string name="xmrto_error_004">BTC amount out of bounds</string> <string name="xmrto_error_004">BTC amount out of bounds</string>
<string name="xmrto_error_010">Invalid or outdated Payment URL</string> <string name="xmrto_error_010">Invalid or outdated Payment URL</string>
<string name="xmrto_error_012">Too many requests</string> <string name="xmrto_error_012">Too many requests</string>
<string name="street_sweep_amount">EVERYTHING!</string> <!-- as in: "everything in the account" = "all the money" -->
</resources> </resources>

View File

@ -358,4 +358,6 @@
<string name="xmrto_error_004">BTC amount out of bounds</string> <string name="xmrto_error_004">BTC amount out of bounds</string>
<string name="xmrto_error_010">Invalid or outdated Payment URL</string> <string name="xmrto_error_010">Invalid or outdated Payment URL</string>
<string name="xmrto_error_012">Too many requests</string> <string name="xmrto_error_012">Too many requests</string>
<string name="street_sweep_amount">EVERYTHING!</string> <!-- as in: "everything in the account" = "all the money" -->
</resources> </resources>

View File

@ -377,4 +377,6 @@
<string name="xmrto_error_004">BTC amount out of bounds</string> <string name="xmrto_error_004">BTC amount out of bounds</string>
<string name="xmrto_error_010">Invalid or outdated Payment URL</string> <string name="xmrto_error_010">Invalid or outdated Payment URL</string>
<string name="xmrto_error_012">Too many requests</string> <string name="xmrto_error_012">Too many requests</string>
<string name="street_sweep_amount">EVERYTHING!</string> <!-- as in: "everything in the account" = "all the money" -->
</resources> </resources>

View File

@ -371,4 +371,6 @@
<string name="xmrto_error_004">BTC amount out of bounds</string> <string name="xmrto_error_004">BTC amount out of bounds</string>
<string name="xmrto_error_010">Invalid or outdated Payment URL</string> <string name="xmrto_error_010">Invalid or outdated Payment URL</string>
<string name="xmrto_error_012">Too many requests</string> <string name="xmrto_error_012">Too many requests</string>
<string name="street_sweep_amount">EVERYTHING!</string> <!-- as in: "everything in the account" = "all the money" -->
</resources> </resources>

View File

@ -373,4 +373,6 @@
<string name="xmrto_error_004">BTC amount out of bounds</string> <string name="xmrto_error_004">BTC amount out of bounds</string>
<string name="xmrto_error_010">Invalid or outdated Payment URL</string> <string name="xmrto_error_010">Invalid or outdated Payment URL</string>
<string name="xmrto_error_012">Too many requests</string> <string name="xmrto_error_012">Too many requests</string>
<string name="street_sweep_amount">EVERYTHING!</string> <!-- as in: "everything in the account" = "all the money" -->
</resources> </resources>

View File

@ -422,4 +422,6 @@
<string name="xmrto_error_012">Too many requests</string> <string name="xmrto_error_012">Too many requests</string>
<string name="xmrto_error" translatable="false">XMR.TO Service Error</string> <string name="xmrto_error" translatable="false">XMR.TO Service Error</string>
<string name="street_sweep_amount">EVERYTHING!</string>
</resources> </resources>