second spend confirmation for mainnet

This commit is contained in:
m2049r 2017-08-29 22:04:39 +02:00
parent e39cd1c988
commit 186ed5cd39
3 changed files with 219 additions and 196 deletions

View File

@ -60,6 +60,7 @@ public class SendFragment extends Fragment {
TextView tvTxDust; TextView tvTxDust;
EditText etNotes; EditText etNotes;
Button bSend; Button bSend;
Button bReallySend;
ProgressBar pbProgress; ProgressBar pbProgress;
final static int Mixins[] = {4, 6, 8, 10, 13}; // must match the layout XML final static int Mixins[] = {4, 6, 8, 10, 13}; // must match the layout XML
@ -90,6 +91,7 @@ public class SendFragment extends Fragment {
tvTxDust = (TextView) view.findViewById(R.id.tvTxDust); tvTxDust = (TextView) view.findViewById(R.id.tvTxDust);
etNotes = (EditText) view.findViewById(R.id.etNotes); etNotes = (EditText) view.findViewById(R.id.etNotes);
bSend = (Button) view.findViewById(R.id.bSend); bSend = (Button) view.findViewById(R.id.bSend);
bReallySend = (Button) view.findViewById(R.id.bReallySend);
pbProgress = (ProgressBar) view.findViewById(R.id.pbProgress); pbProgress = (ProgressBar) view.findViewById(R.id.pbProgress);
@ -229,6 +231,19 @@ public class SendFragment extends Fragment {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
bSend.setEnabled(false); bSend.setEnabled(false);
boolean testnet = WalletManager.getInstance().isTestNet();
if (testnet) {
send();
} else {
bReallySend.setVisibility(View.VISIBLE);
}
}
});
bReallySend.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
bReallySend.setEnabled(false);
send(); send();
} }
}); });
@ -310,6 +325,7 @@ public class SendFragment extends Fragment {
bSweep.setEnabled(true); bSweep.setEnabled(true);
bPrepareSend.setEnabled(true); bPrepareSend.setEnabled(true);
llConfirmSend.setVisibility(View.GONE); llConfirmSend.setVisibility(View.GONE);
bReallySend.setVisibility(View.GONE);
} }
private void send() { private void send() {

View File

@ -1,5 +1,9 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"> android:orientation="vertical">
@ -234,13 +238,15 @@
android:text="@string/send_send_hint" /> android:text="@string/send_send_hint" />
<Button <Button
android:id="@+id/bSend" android:id="@+id/bReallySend"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="8dp" android:layout_marginBottom="8dp"
android:layout_marginTop="8dp" android:layout_marginTop="8dp"
android:background="@color/colorPrimary" android:background="@color/moneroOrange"
android:text="@string/send_send_hint" /> android:text="@string/send_really_send_hint"
android:visibility="gone" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
</ScrollView>

View File

@ -114,6 +114,7 @@
<string name="send_prepare_hint">Prepare</string> <string name="send_prepare_hint">Prepare</string>
<string name="send_dispose_hint">Dispose (Undo)</string> <string name="send_dispose_hint">Dispose (Undo)</string>
<string name="send_send_hint">Spend my sweet Moneroj</string> <string name="send_send_hint">Spend my sweet Moneroj</string>
<string name="send_really_send_hint">I understand I am on mainnet\nTHis is real Monero!</string>
<string name="send_preparing_progress">Preparing transaction</string> <string name="send_preparing_progress">Preparing transaction</string>