mirror of
https://codeberg.org/r4v3r23/mysu.git
synced 2024-11-10 08:00:02 +00:00
working on the send dialog
still need to add a button to scan QR code
This commit is contained in:
parent
3c4b1de1df
commit
fcadb39b76
11 changed files with 263 additions and 52 deletions
|
@ -1,8 +1,11 @@
|
||||||
package com.m2049r.xmrwallet.fragment.dialog;
|
package com.m2049r.xmrwallet.fragment.dialog;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
|
import android.os.AsyncTask;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import com.google.android.material.bottomsheet.BottomSheetDialogFragment;
|
import com.google.android.material.bottomsheet.BottomSheetDialogFragment;
|
||||||
import com.m2049r.xmrwallet.R;
|
import com.m2049r.xmrwallet.R;
|
||||||
|
import com.m2049r.xmrwallet.model.PendingTransaction;
|
||||||
import com.m2049r.xmrwallet.model.Wallet;
|
import com.m2049r.xmrwallet.model.Wallet;
|
||||||
import com.m2049r.xmrwallet.service.BalanceService;
|
import com.m2049r.xmrwallet.service.BalanceService;
|
||||||
import com.m2049r.xmrwallet.service.TxService;
|
import com.m2049r.xmrwallet.service.TxService;
|
||||||
|
@ -25,6 +28,19 @@ import androidx.lifecycle.MutableLiveData;
|
||||||
public class SendBottomSheetDialog extends BottomSheetDialogFragment {
|
public class SendBottomSheetDialog extends BottomSheetDialogFragment {
|
||||||
private MutableLiveData<Boolean> _sendingMax = new MutableLiveData<>(false);
|
private MutableLiveData<Boolean> _sendingMax = new MutableLiveData<>(false);
|
||||||
public LiveData<Boolean> sendingMax = _sendingMax;
|
public LiveData<Boolean> sendingMax = _sendingMax;
|
||||||
|
private MutableLiveData<PendingTransaction> _pendingTransaction = new MutableLiveData<>(null);
|
||||||
|
public LiveData<PendingTransaction> pendingTransaction = _pendingTransaction;
|
||||||
|
|
||||||
|
private EditText addressEditText;
|
||||||
|
private EditText amountEditText;
|
||||||
|
private TextView sendAllTextView;
|
||||||
|
private TextView feeTextView;
|
||||||
|
private TextView addressTextView;
|
||||||
|
private TextView amountTextView;
|
||||||
|
private Button createButton;
|
||||||
|
private Button sendButton;
|
||||||
|
private Button sendMaxButton;
|
||||||
|
private ImageButton pasteAddressImageButton;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||||
|
@ -34,12 +50,16 @@ public class SendBottomSheetDialog extends BottomSheetDialogFragment {
|
||||||
@Override
|
@Override
|
||||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||||
super.onViewCreated(view, savedInstanceState);
|
super.onViewCreated(view, savedInstanceState);
|
||||||
ImageButton pasteAddressImageButton = view.findViewById(R.id.paste_address_imagebutton);
|
pasteAddressImageButton = view.findViewById(R.id.paste_address_imagebutton);
|
||||||
Button sendMaxButton = view.findViewById(R.id.send_max_button);
|
sendMaxButton = view.findViewById(R.id.send_max_button);
|
||||||
EditText addressEditText = view.findViewById(R.id.address_edittext);
|
addressEditText = view.findViewById(R.id.address_edittext);
|
||||||
EditText amountEditText = view.findViewById(R.id.amount_edittext);
|
amountEditText = view.findViewById(R.id.amount_edittext);
|
||||||
Button sendButton = view.findViewById(R.id.send_button);
|
sendButton = view.findViewById(R.id.send_tx_button);
|
||||||
TextView sendAllTextView = view.findViewById(R.id.sending_all_textview);
|
createButton = view.findViewById(R.id.create_tx_button);
|
||||||
|
sendAllTextView = view.findViewById(R.id.sending_all_textview);
|
||||||
|
feeTextView = view.findViewById(R.id.fee_textview);
|
||||||
|
addressTextView = view.findViewById(R.id.address_pending_textview);
|
||||||
|
amountTextView = view.findViewById(R.id.amount_pending_textview);
|
||||||
|
|
||||||
pasteAddressImageButton.setOnClickListener(view1 -> {
|
pasteAddressImageButton.setOnClickListener(view1 -> {
|
||||||
addressEditText.setText(Helper.getClipBoardText(view.getContext()));
|
addressEditText.setText(Helper.getClipBoardText(view.getContext()));
|
||||||
|
@ -50,7 +70,7 @@ public class SendBottomSheetDialog extends BottomSheetDialogFragment {
|
||||||
_sendingMax.postValue(!currentValue);
|
_sendingMax.postValue(!currentValue);
|
||||||
});
|
});
|
||||||
|
|
||||||
sendButton.setOnClickListener(view1 -> {
|
createButton.setOnClickListener(view1 -> {
|
||||||
boolean sendAll = sendingMax.getValue() != null ? sendingMax.getValue() : false;
|
boolean sendAll = sendingMax.getValue() != null ? sendingMax.getValue() : false;
|
||||||
String address = addressEditText.getText().toString().trim();
|
String address = addressEditText.getText().toString().trim();
|
||||||
String amount = amountEditText.getText().toString().trim();
|
String amount = amountEditText.getText().toString().trim();
|
||||||
|
@ -62,13 +82,9 @@ public class SendBottomSheetDialog extends BottomSheetDialogFragment {
|
||||||
Toast.makeText(getActivity(), getString(R.string.send_amount_invalid), Toast.LENGTH_SHORT).show();
|
Toast.makeText(getActivity(), getString(R.string.send_amount_invalid), Toast.LENGTH_SHORT).show();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
sendButton.setEnabled(false);
|
Toast.makeText(getActivity(), getString(R.string.creating_tx), Toast.LENGTH_SHORT).show();
|
||||||
boolean success = TxService.getInstance().sendTx(address, amount, sendAll);
|
createButton.setEnabled(false);
|
||||||
if(success) {
|
createTx(address, amount, sendAll);
|
||||||
dismiss();
|
|
||||||
} else {
|
|
||||||
Toast.makeText(getActivity(), getString(R.string.error_sending_tx), Toast.LENGTH_SHORT).show();
|
|
||||||
}
|
|
||||||
} else if (!validAddress) {
|
} else if (!validAddress) {
|
||||||
Toast.makeText(getActivity(), getString(R.string.send_address_invalid), Toast.LENGTH_SHORT).show();
|
Toast.makeText(getActivity(), getString(R.string.send_address_invalid), Toast.LENGTH_SHORT).show();
|
||||||
} else {
|
} else {
|
||||||
|
@ -76,7 +92,17 @@ public class SendBottomSheetDialog extends BottomSheetDialogFragment {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
sendButton.setOnClickListener(view1 -> {
|
||||||
|
PendingTransaction pendingTx = pendingTransaction.getValue();
|
||||||
|
if(pendingTx != null) {
|
||||||
|
Toast.makeText(getActivity(), getString(R.string.sending_tx), Toast.LENGTH_SHORT).show();
|
||||||
|
sendButton.setEnabled(false);
|
||||||
|
sendTx(pendingTx);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
sendingMax.observe(getViewLifecycleOwner(), sendingMax -> {
|
sendingMax.observe(getViewLifecycleOwner(), sendingMax -> {
|
||||||
|
if(pendingTransaction.getValue() == null) {
|
||||||
if (sendingMax) {
|
if (sendingMax) {
|
||||||
amountEditText.setVisibility(View.INVISIBLE);
|
amountEditText.setVisibility(View.INVISIBLE);
|
||||||
sendAllTextView.setVisibility(View.VISIBLE);
|
sendAllTextView.setVisibility(View.VISIBLE);
|
||||||
|
@ -86,6 +112,79 @@ public class SendBottomSheetDialog extends BottomSheetDialogFragment {
|
||||||
sendAllTextView.setVisibility(View.GONE);
|
sendAllTextView.setVisibility(View.GONE);
|
||||||
sendMaxButton.setText(getText(R.string.send_max));
|
sendMaxButton.setText(getText(R.string.send_max));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
pendingTransaction.observe(getViewLifecycleOwner(), pendingTx -> {
|
||||||
|
showConfirmationLayout(pendingTx != null);
|
||||||
|
|
||||||
|
if(pendingTx != null) {
|
||||||
|
String address = addressEditText.getText().toString();
|
||||||
|
addressTextView.setText(getString(R.string.tx_address_text, address));
|
||||||
|
amountTextView.setText(getString(R.string.tx_amount_text, Helper.getDisplayAmount(pendingTx.getAmount())));
|
||||||
|
feeTextView.setText(getString(R.string.tx_fee_text, Helper.getDisplayAmount(pendingTx.getFee())));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void sendTx(PendingTransaction pendingTx) {
|
||||||
|
AsyncTask.execute(() -> {
|
||||||
|
boolean success = TxService.getInstance().sendTx(pendingTx);
|
||||||
|
Activity activity = getActivity();
|
||||||
|
if(activity != null) {
|
||||||
|
activity.runOnUiThread(() -> {
|
||||||
|
if (success) {
|
||||||
|
Toast.makeText(getActivity(), getString(R.string.sent_tx), Toast.LENGTH_SHORT).show();
|
||||||
|
dismiss();
|
||||||
|
} else {
|
||||||
|
sendButton.setEnabled(true);
|
||||||
|
Toast.makeText(getActivity(), getString(R.string.error_sending_tx), Toast.LENGTH_SHORT).show();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void createTx(String address, String amount, boolean sendAll) {
|
||||||
|
AsyncTask.execute(() -> {
|
||||||
|
PendingTransaction pendingTx = TxService.getInstance().createTx(address, amount, sendAll);
|
||||||
|
if(pendingTx != null) {
|
||||||
|
_pendingTransaction.postValue(pendingTx);
|
||||||
|
} else {
|
||||||
|
Activity activity = getActivity();
|
||||||
|
if(activity != null) {
|
||||||
|
activity.runOnUiThread(() -> {
|
||||||
|
createButton.setEnabled(true);
|
||||||
|
Toast.makeText(getActivity(), getString(R.string.error_creating_tx), Toast.LENGTH_SHORT).show();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private void showConfirmationLayout(boolean show) {
|
||||||
|
if(show) {
|
||||||
|
sendButton.setVisibility(View.VISIBLE);
|
||||||
|
addressEditText.setVisibility(View.GONE);
|
||||||
|
amountEditText.setVisibility(View.GONE);
|
||||||
|
sendAllTextView.setVisibility(View.GONE);
|
||||||
|
createButton.setVisibility(View.GONE);
|
||||||
|
sendMaxButton.setVisibility(View.GONE);
|
||||||
|
pasteAddressImageButton.setVisibility(View.GONE);
|
||||||
|
feeTextView.setVisibility(View.VISIBLE);
|
||||||
|
addressTextView.setVisibility(View.VISIBLE);
|
||||||
|
amountTextView.setVisibility(View.VISIBLE);
|
||||||
|
} else {
|
||||||
|
sendButton.setVisibility(View.GONE);
|
||||||
|
addressEditText.setVisibility(View.VISIBLE);
|
||||||
|
amountEditText.setVisibility(Boolean.TRUE.equals(sendingMax.getValue()) ? View.GONE : View.VISIBLE);
|
||||||
|
sendAllTextView.setVisibility(Boolean.TRUE.equals(sendingMax.getValue()) ? View.VISIBLE : View.GONE);
|
||||||
|
createButton.setVisibility(View.VISIBLE);
|
||||||
|
sendMaxButton.setVisibility(View.VISIBLE);
|
||||||
|
pasteAddressImageButton.setVisibility(View.VISIBLE);
|
||||||
|
feeTextView.setVisibility(View.GONE);
|
||||||
|
addressTextView.setVisibility(View.GONE);
|
||||||
|
amountTextView.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -60,7 +60,7 @@ public class MoneroHandlerThread extends Thread implements WalletListener {
|
||||||
if(usesTor) {
|
if(usesTor) {
|
||||||
String proxy = "127.0.0.1:9050";
|
String proxy = "127.0.0.1:9050";
|
||||||
WalletManager.getInstance().setProxy(proxy);
|
WalletManager.getInstance().setProxy(proxy);
|
||||||
WalletManager.getInstance().setDaemon(Node.fromString(DefaultNodes.MONERUJO_ONION.getUri()));
|
WalletManager.getInstance().setDaemon(Node.fromString(DefaultNodes.boldsuck.getUri()));
|
||||||
wallet.setProxy(proxy);
|
wallet.setProxy(proxy);
|
||||||
} else {
|
} else {
|
||||||
WalletManager.getInstance().setDaemon(Node.fromString(DefaultNodes.XMRTW.getUri()));
|
WalletManager.getInstance().setDaemon(Node.fromString(DefaultNodes.XMRTW.getUri()));
|
||||||
|
@ -118,9 +118,12 @@ public class MoneroHandlerThread extends Thread implements WalletListener {
|
||||||
listener.onRefresh();
|
listener.onRefresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean sendTx(String address, String amountStr, boolean sendAll) {
|
public PendingTransaction createTx(String address, String amountStr, boolean sendAll) {
|
||||||
long amount = sendAll ? SWEEP_ALL : Wallet.getAmountFromString(amountStr);
|
long amount = sendAll ? SWEEP_ALL : Wallet.getAmountFromString(amountStr);
|
||||||
PendingTransaction pendingTx = wallet.createTransaction(new TxData(address, amount, 0, PendingTransaction.Priority.Priority_Default));
|
return wallet.createTransaction(new TxData(address, amount, 0, PendingTransaction.Priority.Priority_Default));
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean sendTx(PendingTransaction pendingTx) {
|
||||||
return pendingTx.commit("", true);
|
return pendingTx.commit("", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@ package com.m2049r.xmrwallet.service;
|
||||||
|
|
||||||
import com.m2049r.xmrwallet.MainActivity;
|
import com.m2049r.xmrwallet.MainActivity;
|
||||||
import com.m2049r.xmrwallet.livedata.SingleLiveEvent;
|
import com.m2049r.xmrwallet.livedata.SingleLiveEvent;
|
||||||
|
import com.m2049r.xmrwallet.model.PendingTransaction;
|
||||||
|
|
||||||
public class TxService extends ServiceBase {
|
public class TxService extends ServiceBase {
|
||||||
public static TxService instance = null;
|
public static TxService instance = null;
|
||||||
|
@ -15,7 +16,11 @@ public class TxService extends ServiceBase {
|
||||||
instance = this;
|
instance = this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean sendTx(String address, String amount, boolean sendAll) {
|
public PendingTransaction createTx(String address, String amount, boolean sendAll) {
|
||||||
return this.getThread().sendTx(address, amount, sendAll);
|
return this.getThread().createTx(address, amount, sendAll);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean sendTx(PendingTransaction pendingTransaction) {
|
||||||
|
return this.getThread().sendTx(pendingTransaction);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,13 +1,7 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
android:shape="rectangle">
|
<!-- Color when the row is selected -->
|
||||||
<padding
|
<item android:state_enabled="true" android:drawable="@drawable/button_bg_enabled" />
|
||||||
android:bottom="12dp"
|
<!-- Standard background color -->
|
||||||
android:left="12dp"
|
<item android:drawable="@drawable/button_bg_disabled" />
|
||||||
android:right="12dp"
|
</selector>
|
||||||
android:top="12dp" />
|
|
||||||
<solid
|
|
||||||
android:color="@color/oled_colorSecondary"/>
|
|
||||||
<corners
|
|
||||||
android:radius="8dp"/>
|
|
||||||
</shape>
|
|
13
app/src/main/res/drawable/button_bg_disabled.xml
Normal file
13
app/src/main/res/drawable/button_bg_disabled.xml
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="rectangle">
|
||||||
|
<padding
|
||||||
|
android:bottom="12dp"
|
||||||
|
android:left="12dp"
|
||||||
|
android:right="12dp"
|
||||||
|
android:top="12dp" />
|
||||||
|
<solid
|
||||||
|
android:color="@color/button_disabled_bg_color"/>
|
||||||
|
<corners
|
||||||
|
android:radius="8dp"/>
|
||||||
|
</shape>
|
13
app/src/main/res/drawable/button_bg_enabled.xml
Normal file
13
app/src/main/res/drawable/button_bg_enabled.xml
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="rectangle">
|
||||||
|
<padding
|
||||||
|
android:bottom="12dp"
|
||||||
|
android:left="12dp"
|
||||||
|
android:right="12dp"
|
||||||
|
android:top="12dp" />
|
||||||
|
<solid
|
||||||
|
android:color="@color/oled_colorSecondary"/>
|
||||||
|
<corners
|
||||||
|
android:radius="8dp"/>
|
||||||
|
</shape>
|
|
@ -62,7 +62,7 @@
|
||||||
android:layout_marginEnd="24dp"
|
android:layout_marginEnd="24dp"
|
||||||
android:layout_marginBottom="16dp"
|
android:layout_marginBottom="16dp"
|
||||||
android:background="@drawable/button_bg"
|
android:background="@drawable/button_bg"
|
||||||
android:text="Receive"
|
android:text="@string/receive"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintEnd_toStartOf="@id/send_button"
|
app:layout_constraintEnd_toStartOf="@id/send_button"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"/>
|
app:layout_constraintBottom_toBottomOf="parent"/>
|
||||||
|
@ -75,7 +75,7 @@
|
||||||
android:layout_marginEnd="24dp"
|
android:layout_marginEnd="24dp"
|
||||||
android:layout_marginBottom="16dp"
|
android:layout_marginBottom="16dp"
|
||||||
android:background="@drawable/button_bg"
|
android:background="@drawable/button_bg"
|
||||||
android:text="Send"
|
android:text="@string/send"
|
||||||
app:layout_constraintStart_toEndOf="@id/receive_button"
|
app:layout_constraintStart_toEndOf="@id/receive_button"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"/>
|
app:layout_constraintBottom_toBottomOf="parent"/>
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:text="@string/display_recovery_phrase"
|
android:text="@string/display_recovery_phrase"
|
||||||
|
android:background="@drawable/button_bg"
|
||||||
android:layout_marginTop="16dp"
|
android:layout_marginTop="16dp"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content">
|
android:layout_height="wrap_content">
|
||||||
|
<!-- CREATE LAYOUT -->
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/send_monero_textview"
|
android:id="@+id/send_monero_textview"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
@ -41,7 +41,8 @@
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintTop_toBottomOf="@id/send_monero_textview"
|
app:layout_constraintTop_toBottomOf="@id/send_monero_textview"
|
||||||
app:layout_constraintEnd_toStartOf="@id/paste_address_imagebutton"
|
app:layout_constraintEnd_toStartOf="@id/paste_address_imagebutton"
|
||||||
app:layout_constraintBottom_toTopOf="@id/amount_edittext"/>
|
app:layout_constraintBottom_toTopOf="@id/amount_edittext"
|
||||||
|
tools:visibility="gone" />
|
||||||
|
|
||||||
<ImageButton
|
<ImageButton
|
||||||
android:id="@+id/paste_address_imagebutton"
|
android:id="@+id/paste_address_imagebutton"
|
||||||
|
@ -57,7 +58,8 @@
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintStart_toEndOf="@id/address_edittext"
|
app:layout_constraintStart_toEndOf="@id/address_edittext"
|
||||||
app:layout_constraintTop_toTopOf="@id/address_edittext"
|
app:layout_constraintTop_toTopOf="@id/address_edittext"
|
||||||
tools:ignore="SpeakableTextPresentCheck" />
|
tools:ignore="SpeakableTextPresentCheck"
|
||||||
|
tools:visibility="gone" />
|
||||||
<EditText
|
<EditText
|
||||||
android:id="@+id/amount_edittext"
|
android:id="@+id/amount_edittext"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
|
@ -69,8 +71,8 @@
|
||||||
android:inputType="numberDecimal"
|
android:inputType="numberDecimal"
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintEnd_toStartOf="@id/send_max_button"
|
app:layout_constraintEnd_toStartOf="@id/send_max_button"
|
||||||
app:layout_constraintBottom_toTopOf="@id/send_button"
|
app:layout_constraintBottom_toTopOf="@id/create_tx_button"
|
||||||
tools:visibility="visible"/>
|
tools:visibility="gone"/>
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/sending_all_textview"
|
android:id="@+id/sending_all_textview"
|
||||||
android:layout_width="0dp"
|
android:layout_width="0dp"
|
||||||
|
@ -85,7 +87,7 @@
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
app:layout_constraintEnd_toStartOf="@id/send_max_button"
|
app:layout_constraintEnd_toStartOf="@id/send_max_button"
|
||||||
app:layout_constraintBottom_toBottomOf="@id/amount_edittext"
|
app:layout_constraintBottom_toBottomOf="@id/amount_edittext"
|
||||||
tools:visibility="visible"/>
|
tools:visibility="gone"/>
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/send_max_button"
|
android:id="@+id/send_max_button"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
@ -96,9 +98,79 @@
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
app:layout_constraintTop_toTopOf="@id/amount_edittext"
|
app:layout_constraintTop_toTopOf="@id/amount_edittext"
|
||||||
app:layout_constraintBottom_toBottomOf="@id/amount_edittext"
|
app:layout_constraintBottom_toBottomOf="@id/amount_edittext"
|
||||||
app:layout_constraintStart_toEndOf="@id/amount_edittext"/>
|
app:layout_constraintStart_toEndOf="@id/amount_edittext"
|
||||||
|
tools:visibility="gone"/>
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/send_button"
|
android:id="@+id/create_tx_button"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="24dp"
|
||||||
|
android:layout_marginEnd="24dp"
|
||||||
|
android:layout_marginTop="32dp"
|
||||||
|
android:background="@drawable/button_bg"
|
||||||
|
android:text="@string/create"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/amount_edittext"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
tools:visibility="gone"/>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!-- SEND LAYOUT -->
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/address_pending_textview"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/tx_address_text"
|
||||||
|
android:layout_marginStart="24dp"
|
||||||
|
android:layout_marginEnd="24dp"
|
||||||
|
android:layout_marginTop="32dp"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:ellipsize="middle"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/send_monero_textview"
|
||||||
|
app:layout_constraintBottom_toTopOf="@id/amount_pending_textview"
|
||||||
|
tools:visibility="visible"/>
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/amount_pending_textview"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/tx_amount_text"
|
||||||
|
android:layout_marginStart="24dp"
|
||||||
|
android:layout_marginEnd="24dp"
|
||||||
|
android:layout_marginTop="32dp"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:visibility="gone"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/address_pending_textview"
|
||||||
|
app:layout_constraintBottom_toTopOf="@id/fee_textview"
|
||||||
|
tools:visibility="visible"/>
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/fee_textview"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/tx_fee_text"
|
||||||
|
android:layout_marginStart="24dp"
|
||||||
|
android:layout_marginEnd="24dp"
|
||||||
|
android:layout_marginTop="32dp"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textStyle="bold"
|
||||||
|
android:visibility="gone"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toBottomOf="@id/amount_pending_textview"
|
||||||
|
app:layout_constraintBottom_toTopOf="@id/send_tx_button"
|
||||||
|
tools:visibility="visible"/>
|
||||||
|
|
||||||
|
<Button
|
||||||
|
android:id="@+id/send_tx_button"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginStart="24dp"
|
android:layout_marginStart="24dp"
|
||||||
|
@ -106,9 +178,10 @@
|
||||||
android:layout_marginTop="32dp"
|
android:layout_marginTop="32dp"
|
||||||
android:background="@drawable/button_bg"
|
android:background="@drawable/button_bg"
|
||||||
android:text="@string/send"
|
android:text="@string/send"
|
||||||
app:layout_constraintTop_toBottomOf="@id/amount_edittext"
|
android:visibility="gone"
|
||||||
app:layout_constraintStart_toStartOf="parent"/>
|
app:layout_constraintTop_toBottomOf="@id/fee_textview"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
tools:visibility="visible"/>
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
</ScrollView>
|
</ScrollView>
|
|
@ -29,6 +29,7 @@
|
||||||
<color name="oled_colorError">@color/oled_negativeColor</color>
|
<color name="oled_colorError">@color/oled_negativeColor</color>
|
||||||
<color name="oled_colorOnError">@color/oled_colorBackground</color>
|
<color name="oled_colorOnError">@color/oled_colorBackground</color>
|
||||||
<color name="edittext_bg_color">#CCCCCC</color>
|
<color name="edittext_bg_color">#CCCCCC</color>
|
||||||
|
<color name="button_disabled_bg_color">#454545</color>
|
||||||
|
|
||||||
<!-- CLASSIC -->
|
<!-- CLASSIC -->
|
||||||
<color name="classic_textColorPrimary">#0C080C</color>
|
<color name="classic_textColorPrimary">#0C080C</color>
|
||||||
|
|
|
@ -542,6 +542,7 @@
|
||||||
<string name="send_max">Send Max</string>
|
<string name="send_max">Send Max</string>
|
||||||
<string name="undo">Undo</string>
|
<string name="undo">Undo</string>
|
||||||
<string name="error_sending_tx">Error sending tx</string>
|
<string name="error_sending_tx">Error sending tx</string>
|
||||||
|
<string name="error_creating_tx">Error creating tx</string>
|
||||||
<string name="create_wallet">Create wallet</string>
|
<string name="create_wallet">Create wallet</string>
|
||||||
<string name="invalid_mnemonic_code">Invalid mnemonic</string>
|
<string name="invalid_mnemonic_code">Invalid mnemonic</string>
|
||||||
<string name="copied_to_clipboard">Copied to clipboard</string>
|
<string name="copied_to_clipboard">Copied to clipboard</string>
|
||||||
|
@ -553,6 +554,7 @@
|
||||||
<string name="amount">0.00</string>
|
<string name="amount">0.00</string>
|
||||||
<string name="sending_all">SENDING ALL</string>
|
<string name="sending_all">SENDING ALL</string>
|
||||||
<string name="send">Send</string>
|
<string name="send">Send</string>
|
||||||
|
<string name="create">Create</string>
|
||||||
<string name="send_monero">Send Monero</string>
|
<string name="send_monero">Send Monero</string>
|
||||||
<string name="recv_monero">Receive Monero</string>
|
<string name="recv_monero">Receive Monero</string>
|
||||||
<string name="more_options">More options</string>
|
<string name="more_options">More options</string>
|
||||||
|
@ -562,4 +564,11 @@
|
||||||
<string name="password">Password</string>
|
<string name="password">Password</string>
|
||||||
<string name="unlock">Unlock</string>
|
<string name="unlock">Unlock</string>
|
||||||
<string name="enter_password">Enter password</string>
|
<string name="enter_password">Enter password</string>
|
||||||
|
<string name="tx_address_text">Address: %1$s</string>
|
||||||
|
<string name="tx_amount_text">Amount: %1$s XMR</string>
|
||||||
|
<string name="tx_fee_text">Fee: %1$s XMR</string>
|
||||||
|
<string name="receive">Receive</string>
|
||||||
|
<string name="creating_tx">Creating transaction…</string>
|
||||||
|
<string name="sending_tx">Sending transaction…</string>
|
||||||
|
<string name="sent_tx">Sent transaction!</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
Loading…
Reference in a new issue