create ExchangeEditText & use without numpad (#613)

This commit is contained in:
m2049r 2019-08-04 13:19:42 +02:00 committed by GitHub
parent 110057c294
commit 0ce5f2b6ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
36 changed files with 147 additions and 492 deletions

View File

@ -144,24 +144,8 @@ public class SendAddressWizardFragment extends SendWizardFragment {
if (bip70 != null) {
// looks good - resolve through xmr.to
processBip70(bip70);
next = null;
} else if (checkAddress()) {
if (llPaymentId.getVisibility() == View.VISIBLE) {
next = etPaymentId;
} else {
next = etNotes;
}
}
}
if (next != null) {
final View focus = next;
etAddress.post(new Runnable() {
@Override
public void run() {
focus.requestFocus();
}
});
}
}
}
});
@ -176,6 +160,7 @@ public class SendAddressWizardFragment extends SendWizardFragment {
Timber.d("isIntegratedAddress");
etPaymentId.getEditText().getText().clear();
llPaymentId.setVisibility(View.INVISIBLE);
etAddress.setError(getString(R.string.info_paymentid_integrated));
tvPaymentIdIntegrated.setVisibility(View.VISIBLE);
llXmrTo.setVisibility(View.INVISIBLE);
sendListener.setMode(SendFragment.Mode.XMR);
@ -208,9 +193,12 @@ public class SendAddressWizardFragment extends SendWizardFragment {
if (clip == null) return;
// clean it up
final String address = clip.replaceAll("[^0-9A-Z-a-z]", "");
if (Wallet.isAddressValid(address) || BitcoinAddressValidator.validate(address))
etAddress.getEditText().setText(address);
else
if (Wallet.isAddressValid(address) || BitcoinAddressValidator.validate(address)) {
final EditText et = etAddress.getEditText();
et.setText(address);
et.setSelection(et.getText().length());
etAddress.requestFocus();
} else
Toast.makeText(getActivity(), getString(R.string.send_address_invalid), Toast.LENGTH_SHORT).show();
}
});
@ -248,7 +236,10 @@ public class SendAddressWizardFragment extends SendWizardFragment {
bPaymentId.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
etPaymentId.getEditText().setText((Wallet.generatePaymentId()));
final EditText et = etPaymentId.getEditText();
et.setText((Wallet.generatePaymentId()));
et.setSelection(et.getText().length());
etPaymentId.requestFocus();
}
});
@ -259,7 +250,6 @@ public class SendAddressWizardFragment extends SendWizardFragment {
if ((event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER) && (event.getAction() == KeyEvent.ACTION_DOWN))
|| (actionId == EditorInfo.IME_ACTION_DONE)) {
etDummy.requestFocus();
Helper.hideKeyboard(getActivity());
return true;
}
return false;
@ -277,7 +267,6 @@ public class SendAddressWizardFragment extends SendWizardFragment {
etDummy = view.findViewById(R.id.etDummy);
etDummy.setRawInputType(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
etDummy.requestFocus();
Helper.hideKeyboard(getActivity());
View tvNfc = view.findViewById(R.id.tvNfc);
NfcManager manager = (NfcManager) getContext().getSystemService(Context.NFC_SERVICE);
@ -551,7 +540,6 @@ public class SendAddressWizardFragment extends SendWizardFragment {
public void onResumeFragment() {
super.onResumeFragment();
Timber.d("onResumeFragment()");
Helper.hideKeyboard(getActivity());
etDummy.requestFocus();
}

View File

@ -21,8 +21,6 @@ import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.m2049r.xmrwallet.R;
@ -30,8 +28,7 @@ import com.m2049r.xmrwallet.data.BarcodeData;
import com.m2049r.xmrwallet.data.TxData;
import com.m2049r.xmrwallet.model.Wallet;
import com.m2049r.xmrwallet.util.Helper;
import com.m2049r.xmrwallet.widget.ExchangeTextView;
import com.m2049r.xmrwallet.widget.NumberPadView;
import com.m2049r.xmrwallet.widget.ExchangeEditText;
import timber.log.Timber;
@ -59,8 +56,7 @@ public class SendAmountWizardFragment extends SendWizardFragment {
}
private TextView tvFunds;
private ExchangeTextView evAmount;
private View llAmount;
private ExchangeEditText etAmount;
private View rlSweep;
private ImageButton ibSweep;
@ -75,12 +71,9 @@ public class SendAmountWizardFragment extends SendWizardFragment {
View view = inflater.inflate(R.layout.fragment_send_amount, container, false);
tvFunds = view.findViewById(R.id.tvFunds);
evAmount = view.findViewById(R.id.evAmount);
((NumberPadView) view.findViewById(R.id.numberPad)).setListener(evAmount);
etAmount = view.findViewById(R.id.etAmount);
rlSweep = view.findViewById(R.id.rlSweep);
llAmount = view.findViewById(R.id.llAmount);
view.findViewById(R.id.ivSweep).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
@ -97,8 +90,7 @@ public class SendAmountWizardFragment extends SendWizardFragment {
}
});
Helper.hideKeyboard(getActivity());
etAmount.requestFocus();
return view;
}
@ -107,11 +99,11 @@ public class SendAmountWizardFragment extends SendWizardFragment {
private void sweepAll(boolean spendAllMode) {
if (spendAllMode) {
ibSweep.setVisibility(View.INVISIBLE);
llAmount.setVisibility(View.GONE);
etAmount.setVisibility(View.GONE);
rlSweep.setVisibility(View.VISIBLE);
} else {
ibSweep.setVisibility(View.VISIBLE);
llAmount.setVisibility(View.VISIBLE);
etAmount.setVisibility(View.VISIBLE);
rlSweep.setVisibility(View.GONE);
}
this.spendAllMode = spendAllMode;
@ -124,12 +116,12 @@ public class SendAmountWizardFragment extends SendWizardFragment {
sendListener.getTxData().setAmount(Wallet.SWEEP_ALL);
}
} else {
if (!evAmount.validate(maxFunds)) {
if (!etAmount.validate(maxFunds)) {
return false;
}
if (sendListener != null) {
String xmr = evAmount.getAmount();
String xmr = etAmount.getAmount();
if (xmr != null) {
sendListener.getTxData().setAmount(Wallet.getAmountFromString(xmr));
} else {
@ -146,7 +138,7 @@ public class SendAmountWizardFragment extends SendWizardFragment {
public void onResumeFragment() {
super.onResumeFragment();
Timber.d("onResumeFragment()");
Helper.hideKeyboard(getActivity());
Helper.showKeyboard(getActivity());
final long funds = getTotalFunds();
maxFunds = 1.0 * funds / 1000000000000L;
if (!sendListener.getActivityCallback().isStreetMode()) {
@ -157,10 +149,10 @@ public class SendAmountWizardFragment extends SendWizardFragment {
getString(R.string.unknown_amount)));
}
// getAmount is null if exchange is in progress
if ((evAmount.getAmount() != null) && evAmount.getAmount().isEmpty()) {
if ((etAmount.getAmount() != null) && etAmount.getAmount().isEmpty()) {
final BarcodeData data = sendListener.popBarcodeData();
if ((data != null) && (data.amount != null)) {
evAmount.setAmount(data.amount);
etAmount.setAmount(data.amount);
}
}
}

View File

@ -31,8 +31,7 @@ import com.m2049r.xmrwallet.data.TxDataBtc;
import com.m2049r.xmrwallet.model.Wallet;
import com.m2049r.xmrwallet.util.Helper;
import com.m2049r.xmrwallet.util.OkHttpHelper;
import com.m2049r.xmrwallet.widget.ExchangeBtcTextView;
import com.m2049r.xmrwallet.widget.NumberPadView;
import com.m2049r.xmrwallet.widget.ExchangeBtcEditText;
import com.m2049r.xmrwallet.widget.SendProgressView;
import com.m2049r.xmrwallet.xmrto.XmrToError;
import com.m2049r.xmrwallet.xmrto.XmrToException;
@ -62,8 +61,7 @@ public class SendBtcAmountWizardFragment extends SendWizardFragment {
}
private TextView tvFunds;
private ExchangeBtcTextView evAmount;
private NumberPadView numberPad;
private ExchangeBtcEditText etAmount;
private TextView tvXmrToParms;
private SendProgressView evParams;
@ -86,24 +84,20 @@ public class SendBtcAmountWizardFragment extends SendWizardFragment {
tvXmrToParms = view.findViewById(R.id.tvXmrToParms);
evAmount = view.findViewById(R.id.evAmount);
numberPad = view.findViewById(R.id.numberPad);
numberPad.setListener(evAmount);
Helper.hideKeyboard(getActivity());
etAmount = view.findViewById(R.id.etAmount);
etAmount.requestFocus();
return view;
}
@Override
public boolean onValidateFields() {
if (!evAmount.validate(maxBtc, minBtc)) {
if (!etAmount.validate(maxBtc, minBtc)) {
return false;
}
if (sendListener != null) {
TxDataBtc txDataBtc = (TxDataBtc) sendListener.getTxData();
String btcString = evAmount.getAmount();
String btcString = etAmount.getAmount();
if (btcString != null) {
try {
double btc = Double.parseDouble(btcString);
@ -122,10 +116,12 @@ public class SendBtcAmountWizardFragment extends SendWizardFragment {
private void setBip70Mode() {
TxDataBtc txDataBtc = (TxDataBtc) sendListener.getTxData();
if (txDataBtc.getBip70() != null) {
numberPad.setVisibility(View.INVISIBLE);
if (txDataBtc.getBip70() == null) {
etAmount.setEditable(true);
Helper.showKeyboard(getActivity());
} else {
numberPad.setVisibility(View.VISIBLE);
etAmount.setEditable(false);
Helper.hideKeyboard(getActivity());
}
}
@ -141,7 +137,6 @@ public class SendBtcAmountWizardFragment extends SendWizardFragment {
public void onResumeFragment() {
super.onResumeFragment();
Timber.d("onResumeFragment()");
Helper.hideKeyboard(getActivity());
final long funds = getTotalFunds();
if (!sendListener.getActivityCallback().isStreetMode()) {
tvFunds.setText(getString(R.string.send_available,
@ -153,7 +148,7 @@ public class SendBtcAmountWizardFragment extends SendWizardFragment {
final BarcodeData data = sendListener.popBarcodeData();
if (data != null) {
if (data.amount != null) {
evAmount.setAmount(data.amount);
etAmount.setAmount(data.amount);
}
}
setBip70Mode();
@ -171,7 +166,7 @@ public class SendBtcAmountWizardFragment extends SendWizardFragment {
getView().post(new Runnable() {
@Override
public void run() {
evAmount.setRate(1.0d / orderParameters.getPrice());
etAmount.setRate(1.0d / orderParameters.getPrice());
NumberFormat df = NumberFormat.getInstance(Locale.US);
df.setMaximumFractionDigits(6);
String min = df.format(orderParameters.getLowerLimit());
@ -211,7 +206,7 @@ public class SendBtcAmountWizardFragment extends SendWizardFragment {
}
private void processOrderParmsError(final Exception ex) {
evAmount.setRate(0);
etAmount.setRate(0);
orderParameters = null;
maxBtc = 0;
minBtc = 0;

View File

@ -19,9 +19,12 @@
package com.m2049r.xmrwallet.widget;
import android.content.Context;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.ArrayAdapter;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.Spinner;
import android.widget.TextView;
@ -31,8 +34,7 @@ import com.m2049r.xmrwallet.util.Helper;
import timber.log.Timber;
public class ExchangeBtcTextView extends LinearLayout
implements NumberPadView.NumberPadListener {
public class ExchangeBtcEditText extends LinearLayout {
String btcAmount = null;
String xmrAmount = null;
@ -67,7 +69,7 @@ public class ExchangeBtcTextView extends LinearLayout
}
void shakeAmountField() {
tvAmountA.startAnimation(Helper.getShakeAnimation(getContext()));
etAmountA.startAnimation(Helper.getShakeAnimation(getContext()));
}
void shakeExchangeField() {
@ -86,31 +88,35 @@ public class ExchangeBtcTextView extends LinearLayout
public void setAmount(String btcAmount) {
this.btcAmount = btcAmount;
tvAmountA.setText(btcAmount);
etAmountA.setText(btcAmount);
xmrAmount = null;
exchange();
}
public void setEditable(boolean editable) {
etAmountA.setEnabled(editable);
}
public String getAmount() {
return btcAmount;
}
TextView tvAmountA;
EditText etAmountA;
TextView tvAmountB;
Spinner sCurrencyA;
Spinner sCurrencyB;
public ExchangeBtcTextView(Context context) {
public ExchangeBtcEditText(Context context) {
super(context);
initializeViews(context);
}
public ExchangeBtcTextView(Context context, AttributeSet attrs) {
public ExchangeBtcEditText(Context context, AttributeSet attrs) {
super(context, attrs);
initializeViews(context);
}
public ExchangeBtcTextView(Context context,
public ExchangeBtcEditText(Context context,
AttributeSet attrs,
int defStyle) {
super(context, attrs, defStyle);
@ -125,13 +131,28 @@ public class ExchangeBtcTextView extends LinearLayout
private void initializeViews(Context context) {
LayoutInflater inflater = (LayoutInflater) context
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
inflater.inflate(R.layout.view_exchange_btc_text, this);
inflater.inflate(R.layout.view_exchange_btc_edit, this);
}
@Override
protected void onFinishInflate() {
super.onFinishInflate();
tvAmountA = findViewById(R.id.tvAmountA);
etAmountA = findViewById(R.id.etAmountA);
etAmountA.addTextChangedListener(new TextWatcher() {
@Override
public void afterTextChanged(Editable s) {
exchange();
}
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
}
});
tvAmountB = findViewById(R.id.tvAmountB);
sCurrencyA = findViewById(R.id.sCurrencyA);
sCurrencyB = findViewById(R.id.sCurrencyB);
@ -146,12 +167,14 @@ public class ExchangeBtcTextView extends LinearLayout
new String[]{"XMR"});
sCurrencyB.setAdapter(xmrAdapter);
sCurrencyB.setEnabled(false);
etAmountA.setFocusable(true);
etAmountA.setFocusableInTouchMode(true);
}
double xmrBtcRate = 0;
public void exchange() {
btcAmount = tvAmountA.getText().toString();
btcAmount = etAmountA.getText().toString();
if (!btcAmount.isEmpty() && (xmrBtcRate > 0)) {
double xmr = xmrBtcRate * Double.parseDouble(btcAmount);
xmrAmount = Helper.getFormattedAmount(xmr, true);
@ -161,38 +184,4 @@ public class ExchangeBtcTextView extends LinearLayout
tvAmountB.setText(getResources().getString(R.string.send_amount_btc_xmr, xmrAmount));
Timber.d("%s BTC =%f> %s XMR", btcAmount, xmrBtcRate, xmrAmount);
}
// deal with attached numpad
@Override
public void onDigitPressed(final int digit) {
tvAmountA.append(String.valueOf(digit));
exchange();
}
@Override
public void onPointPressed() {
//TODO locale?
if (tvAmountA.getText().toString().indexOf('.') == -1) {
if (tvAmountA.getText().toString().isEmpty()) {
tvAmountA.append("0");
}
tvAmountA.append(".");
}
}
@Override
public void onBackSpacePressed() {
String entry = tvAmountA.getText().toString();
int length = entry.length();
if (length > 0) {
tvAmountA.setText(entry.substring(0, entry.length() - 1));
exchange();
}
}
@Override
public void onClearAll() {
tvAmountA.setText(null);
exchange();
}
}

View File

@ -21,11 +21,13 @@ package com.m2049r.xmrwallet.widget;
import android.content.Context;
import android.os.Handler;
import android.os.Looper;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ImageButton;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
@ -43,10 +45,7 @@ import java.util.Locale;
import timber.log.Timber;
public class ExchangeTextView extends LinearLayout
implements NumberPadView.NumberPadListener {
private static String MAX = "\u221E";
public class ExchangeEditText extends LinearLayout {
String xmrAmount = null;
String notXmrAmount = null;
@ -89,7 +88,7 @@ public class ExchangeTextView extends LinearLayout
}
void shakeAmountField() {
tvAmountA.startAnimation(Helper.getShakeAnimation(getContext()));
etAmountA.startAnimation(Helper.getShakeAnimation(getContext()));
}
void shakeExchangeField() {
@ -99,7 +98,7 @@ public class ExchangeTextView extends LinearLayout
public void setAmount(String xmrAmount) {
if (xmrAmount != null) {
setCurrencyA(0);
tvAmountA.setText(xmrAmount);
etAmountA.setText(xmrAmount);
setXmr(xmrAmount);
this.notXmrAmount = null;
doExchange();
@ -114,7 +113,7 @@ public class ExchangeTextView extends LinearLayout
return xmrAmount;
}
TextView tvAmountA;
EditText etAmountA;
TextView tvAmountB;
Spinner sCurrencyA;
Spinner sCurrencyB;
@ -146,17 +145,17 @@ public class ExchangeTextView extends LinearLayout
return sCurrencyB.getSelectedItemPosition();
}
public ExchangeTextView(Context context) {
public ExchangeEditText(Context context) {
super(context);
initializeViews(context);
}
public ExchangeTextView(Context context, AttributeSet attrs) {
public ExchangeEditText(Context context, AttributeSet attrs) {
super(context, attrs);
initializeViews(context);
}
public ExchangeTextView(Context context,
public ExchangeEditText(Context context,
AttributeSet attrs,
int defStyle) {
super(context, attrs, defStyle);
@ -171,13 +170,28 @@ public class ExchangeTextView extends LinearLayout
private void initializeViews(Context context) {
LayoutInflater inflater = (LayoutInflater) context
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
inflater.inflate(R.layout.view_exchange_text, this);
inflater.inflate(R.layout.view_exchange_edit, this);
}
@Override
protected void onFinishInflate() {
super.onFinishInflate();
tvAmountA = findViewById(R.id.tvAmountA);
etAmountA = findViewById(R.id.etAmountA);
etAmountA.addTextChangedListener(new TextWatcher() {
@Override
public void afterTextChanged(Editable s) {
doExchange();
}
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
}
});
tvAmountB = findViewById(R.id.tvAmountB);
sCurrencyA = findViewById(R.id.sCurrencyA);
sCurrencyB = findViewById(R.id.sCurrencyB);
@ -317,7 +331,7 @@ public class ExchangeTextView extends LinearLayout
boolean prepareExchange() {
Timber.d("prepareExchange()");
String enteredAmount = tvAmountA.getText().toString();
String enteredAmount = etAmountA.getText().toString();
if (!enteredAmount.isEmpty()) {
String cleanAmount = "";
if (getCurrencyA() == 0) {
@ -426,37 +440,4 @@ public class ExchangeTextView extends LinearLayout
public void setOnFailedExchangeListener(OnFailedExchangeListener listener) {
onFailedExchangeListener = listener;
}
@Override
public void onDigitPressed(final int digit) {
tvAmountA.append(String.valueOf(digit));
doExchange();
}
@Override
public void onPointPressed() {
//TODO locale?
if (tvAmountA.getText().toString().indexOf('.') == -1) {
if (tvAmountA.getText().toString().isEmpty()) {
tvAmountA.append("0");
}
tvAmountA.append(".");
}
}
@Override
public void onBackSpacePressed() {
String entry = tvAmountA.getText().toString();
int length = entry.length();
if (length > 0) {
tvAmountA.setText(entry.substring(0, entry.length() - 1));
doExchange();
}
}
@Override
public void onClearAll() {
tvAmountA.setText(null);
doExchange();
}
}

View File

@ -48,18 +48,9 @@ import java.util.Locale;
import timber.log.Timber;
// TODO combine this with ExchangeTextView
public class ExchangeView extends LinearLayout
implements NumberPadView.NumberPadListener {
public void enableSoftKeyboard(final boolean isEnabled) {
etAmount.getEditText().setShowSoftInputOnFocus(isEnabled);
}
public boolean focus() {
return etAmount.requestFocus();
}
public class ExchangeView extends LinearLayout {
String xmrAmount = null;
String notXmrAmount = null;
public void enable(boolean enable) {
etAmount.setEnabled(enable);
@ -67,9 +58,6 @@ public class ExchangeView extends LinearLayout
sCurrencyB.setEnabled(enable);
}
String xmrAmount = null;
String notXmrAmount = null;
void setXmr(String xmr) {
xmrAmount = xmr;
if (onNewAmountListener != null) {
@ -482,31 +470,4 @@ public class ExchangeView extends LinearLayout
public void setOnFailedExchangeListener(OnFailedExchangeListener listener) {
onFailedExchangeListener = listener;
}
@Override
public void onDigitPressed(final int digit) {
etAmount.getEditText().append(String.valueOf(digit));
}
@Override
public void onPointPressed() {
//TODO locale?
if (etAmount.getEditText().getText().toString().indexOf('.') == -1) {
etAmount.getEditText().append(".");
}
}
@Override
public void onBackSpacePressed() {
Editable editable = etAmount.getEditText().getText();
int length = editable.length();
if (length > 0) {
editable.delete(length - 1, length);
}
}
@Override
public void onClearAll() {
etAmount.getEditText().getText().clear();
}
}

View File

@ -1,87 +0,0 @@
package com.m2049r.xmrwallet.widget;
import android.content.Context;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.view.View;
import android.widget.LinearLayout;
import com.m2049r.xmrwallet.R;
public class NumberPadView extends LinearLayout
implements View.OnClickListener, View.OnLongClickListener {
@Override
public void onClick(final View view) {
if (listener == null) {
throw new IllegalArgumentException("NumberPadListener has to be set, use setListener() to set it.");
}
switch (view.getId()) {
case R.id.numberPadPoint:
listener.onPointPressed();
break;
case R.id.numberPadBackSpace:
listener.onBackSpacePressed();
break;
default:
if (view.getTag() != null) {
listener.onDigitPressed(Integer.parseInt(view.getTag().toString()));
}
}
}
@Override
public boolean onLongClick(final View view) {
if (view.getId() == R.id.numberPadBackSpace) {
listener.onClearAll();
return true;
}
return false;
}
public void setListener(final NumberPadListener listener) {
this.listener = listener;
}
public interface NumberPadListener {
void onDigitPressed(final int digit);
void onBackSpacePressed();
void onPointPressed();
void onClearAll();
}
private NumberPadListener listener;
public NumberPadView(final Context context) {
this(context, null);
}
public NumberPadView(final Context context,
@Nullable final AttributeSet attrs) {
this(context, attrs, 0);
}
public NumberPadView(final Context context, @Nullable final AttributeSet attrs,
final int defStyleAttr) {
super(context, attrs, defStyleAttr);
final View view = View.inflate(context, R.layout.view_number_pad, this);
setOrientation(VERTICAL);
view.findViewById(R.id.numberPad0).setOnClickListener(this);
view.findViewById(R.id.numberPad1).setOnClickListener(this);
view.findViewById(R.id.numberPad2).setOnClickListener(this);
view.findViewById(R.id.numberPad3).setOnClickListener(this);
view.findViewById(R.id.numberPad4).setOnClickListener(this);
view.findViewById(R.id.numberPad5).setOnClickListener(this);
view.findViewById(R.id.numberPad6).setOnClickListener(this);
view.findViewById(R.id.numberPad7).setOnClickListener(this);
view.findViewById(R.id.numberPad8).setOnClickListener(this);
view.findViewById(R.id.numberPad9).setOnClickListener(this);
view.findViewById(R.id.numberPadPoint).setOnClickListener(this);
view.findViewById(R.id.numberPadBackSpace).setOnClickListener(this);
view.findViewById(R.id.numberPadBackSpace).setOnLongClickListener(this);
}
}

View File

@ -75,7 +75,7 @@
android:drawableStart="@drawable/ic_check_gray_24dp"
android:drawablePadding="8dp"
android:gravity="center"
android:text="@string/info_paymentid_intergrated"
android:text="@string/info_paymentid_integrated"
android:textSize="18sp"
android:visibility="invisible" />

View File

@ -27,35 +27,19 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:paddingEnd="12dp"
android:paddingStart="12dp"
android:paddingEnd="12dp"
android:src="@drawable/ic_all_inclusive_24dp"
android:visibility="visible" />
</RelativeLayout>
<LinearLayout
android:id="@+id/llAmount"
<com.m2049r.xmrwallet.widget.ExchangeEditText
android:id="@+id/etAmount"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:visibility="visible">
<com.m2049r.xmrwallet.widget.ExchangeTextView
android:id="@+id/evAmount"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:layout_marginTop="16dp"
android:orientation="vertical" />
<com.m2049r.xmrwallet.widget.NumberPadView
android:id="@+id/numberPad"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:gravity="center" />
</LinearLayout>
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_marginBottom="16dp"
android:orientation="vertical" />
<RelativeLayout
android:id="@+id/rlSweep"

View File

@ -53,19 +53,11 @@
</LinearLayout>
</FrameLayout>
<com.m2049r.xmrwallet.widget.ExchangeBtcTextView
android:id="@+id/evAmount"
<com.m2049r.xmrwallet.widget.ExchangeBtcEditText
android:id="@+id/etAmount"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:layout_marginTop="16dp"
android:orientation="vertical" />
<com.m2049r.xmrwallet.widget.NumberPadView
android:id="@+id/numberPad"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:gravity="center" />
</LinearLayout>

View File

@ -17,8 +17,8 @@
android:gravity="center"
android:textAlignment="center" />
<TextView
android:id="@+id/tvAmountA"
<EditText
android:id="@+id/etAmountA"
style="@style/MoneroText.Balance.Orange"
android:layout_width="0dp"
android:layout_height="wrap_content"
@ -26,10 +26,12 @@
android:layout_marginStart="16dp"
android:layout_weight="3"
android:hint="@string/send_amount_hint"
android:imeOptions="actionDone"
android:inputType="numberDecimal"
android:padding="4dp"
android:singleLine="true"
android:textAlignment="textStart"
tools:text="87.00000" />
</LinearLayout>
<LinearLayout

View File

@ -18,8 +18,8 @@
android:gravity="center"
android:textAlignment="center" />
<TextView
android:id="@+id/tvAmountA"
<EditText
android:id="@+id/etAmountA"
style="@style/MoneroText.Balance.Orange"
android:layout_width="0dp"
android:layout_height="wrap_content"
@ -27,10 +27,12 @@
android:layout_marginStart="16dp"
android:layout_weight="3"
android:hint="@string/send_amount_hint"
android:imeOptions="actionDone"
android:inputType="numberDecimal"
android:padding="4dp"
android:singleLine="true"
android:textAlignment="textStart"
tools:text="87.00000" />
</LinearLayout>
<LinearLayout
@ -66,8 +68,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginEnd="0sp"
android:layout_marginStart="8sp">
android:layout_marginStart="8sp"
android:layout_marginEnd="0sp">
<ImageView
android:id="@+id/evExchange"

View File

@ -1,144 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:showIn="LinearLayout">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:gravity="center">
<TextView
android:id="@+id/numberPad1"
style="@style/MoneroLabel.NumPad"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:tag="1"
android:text="1" />
<TextView
android:id="@+id/numberPad2"
style="@style/MoneroLabel.NumPad"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:tag="2"
android:text="2" />
<TextView
android:id="@+id/numberPad3"
style="@style/MoneroLabel.NumPad"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:tag="3"
android:text="3" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:gravity="center">
<TextView
android:id="@+id/numberPad4"
style="@style/MoneroLabel.NumPad"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:tag="4"
android:text="4" />
<TextView
android:id="@+id/numberPad5"
style="@style/MoneroLabel.NumPad"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:tag="5"
android:text="5" />
<TextView
android:id="@+id/numberPad6"
style="@style/MoneroLabel.NumPad"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:tag="6"
android:text="6" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:gravity="center">
<TextView
android:id="@+id/numberPad7"
style="@style/MoneroLabel.NumPad"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:tag="7"
android:text="7" />
<TextView
android:id="@+id/numberPad8"
style="@style/MoneroLabel.NumPad"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:tag="8"
android:text="8" />
<TextView
android:id="@+id/numberPad9"
style="@style/MoneroLabel.NumPad"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:tag="9"
android:text="9" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:gravity="center">
<TextView
android:id="@+id/numberPadPoint"
style="@style/MoneroLabel.NumPad"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="." />
<TextView
android:id="@+id/numberPad0"
style="@style/MoneroLabel.NumPad"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:tag="0"
android:text="0" />
<ImageView
android:id="@+id/numberPadBackSpace"
android:layout_width="0dp"
android:layout_height="36sp"
android:layout_gravity="center"
android:layout_weight="1"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:src="@drawable/ic_backspace_black_36dp" />
</LinearLayout>
</merge>

View File

@ -58,7 +58,7 @@
<string name="send_available_btc">Balanç: %2$s BTC (%1$s XMR)</string>
<string name="info_paymentid_intergrated">ID de pagment integrat</string>
<string name="info_paymentid_integrated">&#x2714; ID de pagment integrat</string>
<string name="info_prepare_tx">Preparant la seva transacció</string>
<string name="label_send_progress_xmrto_create">Creant ordre XMR.TO</string>

View File

@ -59,7 +59,7 @@
<string name="send_available_btc">Guthaben: %2$s BTC (%1$s XMR)</string>
<string name="info_paymentid_intergrated">Zahlungs-ID integriert</string>
<string name="info_paymentid_integrated">&#x2714; Zahlungs-ID integriert</string>
<string name="info_prepare_tx">Bereite deine Transaktion vor</string>
<string name="label_send_progress_xmrto_create">Erstelle XMR.TO-Auftrag</string>

View File

@ -57,7 +57,7 @@
<string name="send_available_btc">Σύνολο: %2$s BTC (%1$s XMR)</string>
<string name="info_paymentid_intergrated">ID πληρωμής ενσωματωμένο</string>
<string name="info_paymentid_integrated">&#x2714; ID πληρωμής ενσωματωμένο</string>
<string name="info_prepare_tx">Προετοιμασία της συναλλαγής σου</string>
<string name="label_send_progress_xmrto_create">Δημιουργία εντολής με XMR.TO</string>

View File

@ -58,7 +58,7 @@
<string name="send_available_btc">Saldo: %2$s BTC (%1$s XMR)</string>
<string name="info_paymentid_intergrated">Paga-ID integriĝis</string>
<string name="info_paymentid_integrated">&#x2714; Paga-ID integriĝis</string>
<string name="info_prepare_tx">Preparante vian transakcion</string>
<string name="label_send_progress_xmrto_create">Kreante mendon al XMR.TO</string>

View File

@ -30,7 +30,7 @@
<string name="label_receive_info_gen_qr_code">Toca para mostrar código QR</string>
<string name="info_paymentid_intergrated">ID de pago integrado</string>
<string name="info_paymentid_integrated">&#x2714; ID de pago integrado</string>
<string name="info_prepare_tx">Preparando tu transacción</string>
<string name="message_copy_txid">¡ID de transacción copiado al portapapeles!</string>

View File

@ -58,7 +58,7 @@
<string name="send_available_btc">Kontojääk: %2$s BTC (%1$s XMR)</string>
<string name="info_paymentid_intergrated">Makse ID integreeritud</string>
<string name="info_paymentid_integrated">&#x2714; Makse ID integreeritud</string>
<string name="info_prepare_tx">Valmistan ülekannet ette</string>
<string name="label_send_progress_xmrto_create">Loon XMR.TO tellimust</string>

View File

@ -59,7 +59,7 @@
<string name="send_available_btc">Solde : %2$s BTC (%1$s XMR)</string>
<string name="info_paymentid_intergrated">ID de Paiement intégré</string>
<string name="info_paymentid_integrated">&#x2714; ID de Paiement intégré</string>
<string name="info_prepare_tx">Préparation de votre transaction</string>
<string name="label_send_progress_xmrto_create">Création de l\'ordre XMR.TO</string>

View File

@ -58,7 +58,7 @@
<string name="send_available_btc">Egyenleg: %2$s BTC (%1$s XMR)</string>
<string name="info_paymentid_intergrated">Fizetési azonosító integrálva</string>
<string name="info_paymentid_integrated">&#x2714; Fizetési azonosító integrálva</string>
<string name="info_prepare_tx">Tranzakció előkészítése</string>
<string name="label_send_progress_xmrto_create">XMR.TO megrendelés létrehozása</string>

View File

@ -59,7 +59,7 @@
<string name="send_available_btc">Saldo: %2$s BTC (%1$s XMR)</string>
<string name="info_paymentid_intergrated">ID pagamento integrato</string>
<string name="info_paymentid_integrated">&#x2714; ID pagamento integrato</string>
<string name="info_prepare_tx">Preparando la tua transazione</string>
<string name="label_send_progress_xmrto_create">Creando l\'ordine XMR.TO</string>

View File

@ -59,7 +59,7 @@
<string name="send_available_btc">残高: %2$s BTC (%1$s XMR)</string>
<string name="info_paymentid_intergrated">ペイメントID組み込み済み</string>
<string name="info_paymentid_integrated">&#x2714; ペイメントID組み込み済み</string>
<string name="info_prepare_tx">取引を準備しています</string>
<string name="label_send_progress_xmrto_create">XMR.TO の注文を作成しています</string>

View File

@ -57,7 +57,7 @@
<string name="send_available_btc">Saldo: %2$s BTC (%1$s XMR)</string>
<string name="info_paymentid_intergrated">Betalings ID integrert</string>
<string name="info_paymentid_integrated">&#x2714; Betalings ID integrert</string>
<string name="info_prepare_tx">Forbereder din transaksjon</string>
<string name="label_send_progress_xmrto_create">Lager XMR.TO ordre</string>

View File

@ -58,7 +58,7 @@
<string name="send_available_btc">Saldo: %2$s BTC (%1$s XMR)</string>
<string name="info_paymentid_intergrated">Betalings-ID geïntegreerd</string>
<string name="info_paymentid_integrated">&#x2714; Betalings-ID geïntegreerd</string>
<string name="info_prepare_tx">Transactie wordt voorbereid</string>
<string name="label_send_progress_xmrto_create">XMR.TO-opdracht maken</string>

View File

@ -58,7 +58,7 @@
<string name="send_available_btc">Saldo: %2$s BTC (%1$s XMR)</string>
<string name="info_paymentid_intergrated">ID do pagamento integrado</string>
<string name="info_paymentid_integrated">&#x2714; ID do pagamento integrado</string>
<string name="info_prepare_tx">Preparando sua transação</string>
<string name="label_send_progress_xmrto_create">Criando a ordem no XMR.TO</string>

View File

@ -58,7 +58,7 @@
<string name="send_available_btc">Saldo: %2$s BTC (%1$s XMR)</string>
<string name="info_paymentid_intergrated">ID do pagamento integrado</string>
<string name="info_paymentid_integrated">&#x2714; ID do pagamento integrado</string>
<string name="info_prepare_tx">A preparar a transacção</string>
<string name="label_send_progress_xmrto_create">A criar um pedido XMR.TO</string>

View File

@ -57,7 +57,7 @@
<string name="send_available_btc">Balanță: %2$s BTC (%1$s XMR)</string>
<string name="info_paymentid_intergrated">Payment ID integrat</string>
<string name="info_paymentid_integrated">&#x2714; Payment ID integrat</string>
<string name="info_prepare_tx">Se pregătește tranzacția</string>
<string name="label_send_progress_xmrto_create">Creearea ordinului XMR.TO</string>

View File

@ -59,7 +59,7 @@
<string name="send_available_btc">Баланс: %2$s BTC (%1$s XMR)</string>
<string name="info_paymentid_intergrated">Интегрированный ID платежа</string>
<string name="info_paymentid_integrated">&#x2714; Интегрированный ID платежа</string>
<string name="info_prepare_tx">Подготовка транзакции</string>
<string name="label_send_progress_xmrto_create">Создание заказа XMR.TO</string>

View File

@ -59,7 +59,7 @@
<string name="send_available_btc">Zostatok: %2$s BTC (%1$s XMR)</string>
<string name="info_paymentid_intergrated">Payment ID integrované</string>
<string name="info_paymentid_integrated">&#x2714; Payment ID integrované</string>
<string name="info_prepare_tx">Pripravujem transakciu</string>
<string name="label_send_progress_xmrto_create">Vytváram objednávku na XMR.TO</string>

View File

@ -59,7 +59,7 @@
<string name="send_available_btc">Stanje: %2$s BTC (%1$s XMR)</string>
<string name="info_paymentid_intergrated">ID plaćanja integrisan</string>
<string name="info_paymentid_integrated">&#x2714; ID plaćanja integrisan</string>
<string name="info_prepare_tx">Priprema tvoje transakcije</string>
<string name="label_send_progress_xmrto_create">Kreiranje XMR.TO Nalog</string>

View File

@ -51,7 +51,7 @@
<string name="send_available_btc">Saldo: %2$s BTC (%1$s XMR)</string>
<string name="info_paymentid_intergrated">Betalnings-ID integrerat</string>
<string name="info_paymentid_integrated">&#x2714; Betalnings-ID integrerat</string>
<string name="info_prepare_tx">Förbereder din transaktion</string>
<string name="label_send_progress_xmrto_create">Skapar XMR.TO-beställning</string>

View File

@ -59,7 +59,7 @@
<string name="send_available_btc">Баланс: %2$s BTC (%1$s XMR)</string>
<string name="info_paymentid_intergrated">Інтегрований ID платежу</string>
<string name="info_paymentid_integrated">&#x2714; Інтегрований ID платежу</string>
<string name="info_prepare_tx">Підготовка транзакції</string>
<string name="label_send_progress_xmrto_create">Створення заявки XMR.TO</string>

View File

@ -44,7 +44,7 @@
<i>至多<b>%1$s BTC</b>将会<u>即刻</u>发送!</i>
]]></string>
<string name="send_available_btc">余额: %2$s BTC (%1$s XMR)</string>
<string name="info_paymentid_intergrated">支付ID已集成</string>
<string name="info_paymentid_integrated">&#x2714; 支付ID已集成</string>
<string name="info_prepare_tx">正在为您的交易做准备工作</string>
<string name="label_send_progress_xmrto_create">创建XMR.TO订单</string>
<string name="label_send_progress_xmrto_query">XMR.TO订单查询中</string>

View File

@ -59,7 +59,7 @@
<string name="send_available_btc">餘額:%2$s BTC (%1$s XMR)</string>
<string name="info_paymentid_intergrated">已加入付款 ID</string>
<string name="info_paymentid_integrated">&#x2714; 已加入付款 ID</string>
<string name="info_prepare_tx">正在準備你的交易</string>
<string name="label_send_progress_xmrto_create">建立 XMR.TO 訂單</string>

View File

@ -59,7 +59,7 @@
<string name="send_available_btc">Balance: %2$s BTC (%1$s XMR)</string>
<string name="info_paymentid_intergrated">Payment ID integrated</string>
<string name="info_paymentid_integrated">&#x2714; Payment ID integrated</string>
<string name="info_prepare_tx">Preparing your transaction</string>
<string name="label_send_progress_xmrto_create">Creating XMR.TO Order</string>