1
mirror of https://github.com/m2049r/xmrwallet synced 2025-09-06 02:27:11 +02:00

Compare commits

...

25 Commits

Author SHA1 Message Date
m2049r
a4b9a7c6fb fix spend amount & new version (#635) 2019-11-10 15:23:33 +01:00
m2049r
9f01155cb7 v1.12.1 2019-11-10 12:14:52 +01:00
m2049r
08e8a48138 scan only for 0.15 nodes (#634) 2019-11-10 12:13:06 +01:00
m2049r
551c3b9fb6 scan only for 0.15 nodes (#633) 2019-11-10 12:11:01 +01:00
m2049r
2258cb7096 v1.12.0 (#632) 2019-11-10 11:08:19 +01:00
m2049r
6d61841cf3 textfields are filled (#631) 2019-11-10 11:06:34 +01:00
m2049r
c65508d288 upgrade to monero v0.15 (#630) 2019-11-09 22:45:54 +01:00
m2049r
2c3f582672 paste bip70 (#621) 2019-09-22 10:09:18 +02:00
m2049r
f46ba75771 update gradle version (#614) 2019-08-16 19:07:12 +02:00
m2049r
0ce5f2b6ca create ExchangeEditText & use without numpad (#613) 2019-08-04 13:19:42 +02:00
m2049r
110057c294 bump version to 1.11.13 2019-07-14 13:18:27 +02:00
m2049r
7553d3c5f4 Merge pull request #611 from m2049r/fix_heightfix
reduce restore height some more for new wallets
2019-07-14 12:53:24 +02:00
m2049r
317976b34a decrease restore height on new wallet 2019-07-14 12:52:43 +02:00
m2049r
6ad423567f Merge pull request #610 from m2049r/feature_showheight
show restore height
2019-07-14 12:52:21 +02:00
m2049r
d497158856 show restore height 2019-07-14 12:35:00 +02:00
m2049r
f4cada5fa1 Merge pull request #608 from m2049r/feature_nanox
Support for Nano X
2019-07-13 18:56:23 +02:00
m2049r
352f0ad09c update height for 2019-07-01 (#609) 2019-07-13 18:55:35 +02:00
m2049r
ff1a9c1570 verify monero app is running on nano 2019-07-13 18:44:56 +02:00
m2049r
fa811a39a2 accept Nano X over USB 2019-07-13 13:00:24 +02:00
m2049r
cf5018be33 kick 'Hintergrunddienst' (#607) 2019-06-23 21:26:29 +02:00
m2049r
8ec027f9d4 bump version 2019-06-21 08:47:22 +02:00
m2049r
f28428e677 update june restore height (#606) 2019-06-21 08:45:09 +02:00
m2049r
294084bec5 double size of node bookmark icon (#605) 2019-06-21 08:17:08 +02:00
m2049r
4349907627 setNode blocks => call it async (#604) 2019-06-18 08:49:51 +02:00
m2049r
f7cef24a83 fix NPE (#603) 2019-06-18 08:48:28 +02:00
72 changed files with 848 additions and 950 deletions

View File

@@ -155,6 +155,18 @@ add_library(net STATIC IMPORTED)
set_target_properties(net PROPERTIES IMPORTED_LOCATION set_target_properties(net PROPERTIES IMPORTED_LOCATION
${EXTERNAL_LIBS_DIR}/monero/lib/${ANDROID_ABI}/libnet.a) ${EXTERNAL_LIBS_DIR}/monero/lib/${ANDROID_ABI}/libnet.a)
add_library(hardforks STATIC IMPORTED)
set_target_properties(hardforks PROPERTIES IMPORTED_LOCATION
${EXTERNAL_LIBS_DIR}/monero/lib/${ANDROID_ABI}/libhardforks.a)
add_library(randomx STATIC IMPORTED)
set_target_properties(randomx PROPERTIES IMPORTED_LOCATION
${EXTERNAL_LIBS_DIR}/monero/lib/${ANDROID_ABI}/librandomx.a)
add_library(rpc_base STATIC IMPORTED)
set_target_properties(rpc_base PROPERTIES IMPORTED_LOCATION
${EXTERNAL_LIBS_DIR}/monero/lib/${ANDROID_ABI}/librpc_base.a)
############# #############
# System # System
############# #############
@@ -188,6 +200,9 @@ target_link_libraries( monerujo
device_trezor device_trezor
multisig multisig
version version
randomx
hardforks
rpc_base
boost_chrono boost_chrono
boost_date_time boost_date_time

View File

@@ -7,8 +7,8 @@ android {
applicationId "com.m2049r.xmrwallet" applicationId "com.m2049r.xmrwallet"
minSdkVersion 21 minSdkVersion 21
targetSdkVersion 28 targetSdkVersion 28
versionCode 180 versionCode 193
versionName "1.11.10 'Chernushka'" versionName "1.12.3 'Caerbannog'"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
externalNativeBuild { externalNativeBuild {

View File

@@ -1310,7 +1310,6 @@ Java_com_m2049r_xmrwallet_model_PendingTransaction_getFirstTxIdJ(JNIEnv *env, jo
return nullptr; return nullptr;
} }
JNIEXPORT jlong JNICALL JNIEXPORT jlong JNICALL
Java_com_m2049r_xmrwallet_model_PendingTransaction_getTxCount(JNIEnv *env, jobject instance) { Java_com_m2049r_xmrwallet_model_PendingTransaction_getTxCount(JNIEnv *env, jobject instance) {
Bitmonero::PendingTransaction *tx = getHandle<Bitmonero::PendingTransaction>(env, instance); Bitmonero::PendingTransaction *tx = getHandle<Bitmonero::PendingTransaction>(env, instance);
@@ -1396,6 +1395,11 @@ Java_com_m2049r_xmrwallet_model_WalletManager_setLogLevel(JNIEnv *env, jclass cl
Bitmonero::WalletManagerFactory::setLogLevel(level); Bitmonero::WalletManagerFactory::setLogLevel(level);
} }
JNIEXPORT jstring JNICALL
Java_com_m2049r_xmrwallet_model_WalletManager_moneroVersion(JNIEnv *env, jclass clazz) {
return env->NewStringUTF(MONERO_VERSION);
}
// //
// Ledger Stuff // Ledger Stuff
// //

View File

@@ -54,6 +54,8 @@ extern "C"
{ {
#endif #endif
extern const char* const MONERO_VERSION; // the actual monero core version
// from monero-core crypto/hash-ops.h - avoid #including monero code here // from monero-core crypto/hash-ops.h - avoid #including monero code here
enum { enum {
HASH_SIZE = 32, HASH_SIZE = 32,

View File

@@ -46,8 +46,12 @@ public class BTChipTransportAndroidHID implements BTChipTransport {
HashMap<String, UsbDevice> deviceList = manager.getDeviceList(); HashMap<String, UsbDevice> deviceList = manager.getDeviceList();
for (UsbDevice device : deviceList.values()) { for (UsbDevice device : deviceList.values()) {
Timber.d("%04X:%04X %s, %s", device.getVendorId(), device.getProductId(), device.getManufacturerName(), device.getProductName()); Timber.d("%04X:%04X %s, %s", device.getVendorId(), device.getProductId(), device.getManufacturerName(), device.getProductName());
if ((device.getVendorId() == VID) && (device.getProductId() == PID_HID)) { if (device.getVendorId() == VID) {
return device; final int deviceProductId = device.getProductId();
for (int pid : PID_HIDS) {
if (deviceProductId == pid)
return device;
}
} }
} }
return null; return null;
@@ -74,7 +78,7 @@ public class BTChipTransportAndroidHID implements BTChipTransport {
} }
private static final int VID = 0x2C97; private static final int VID = 0x2C97;
private static final int PID_HID = 0x0001; private static final int[] PID_HIDS = {0x0001, 0x0004};
private UsbDeviceConnection connection; private UsbDeviceConnection connection;
private UsbInterface dongleInterface; private UsbInterface dongleInterface;

View File

@@ -55,6 +55,8 @@ import com.m2049r.xmrwallet.util.KeyStoreHelper;
import com.m2049r.xmrwallet.util.MoneroThreadPoolExecutor; import com.m2049r.xmrwallet.util.MoneroThreadPoolExecutor;
import com.m2049r.xmrwallet.widget.Toolbar; import com.m2049r.xmrwallet.widget.Toolbar;
import java.text.NumberFormat;
import timber.log.Timber; import timber.log.Timber;
public class GenerateReviewFragment extends Fragment { public class GenerateReviewFragment extends Fragment {
@@ -72,6 +74,7 @@ public class GenerateReviewFragment extends Fragment {
private TextView tvWalletPassword; private TextView tvWalletPassword;
private TextView tvWalletAddress; private TextView tvWalletAddress;
private TextView tvWalletMnemonic; private TextView tvWalletMnemonic;
private TextView tvWalletHeight;
private TextView tvWalletViewKey; private TextView tvWalletViewKey;
private TextView tvWalletSpendKey; private TextView tvWalletSpendKey;
private ImageButton bCopyAddress; private ImageButton bCopyAddress;
@@ -99,6 +102,7 @@ public class GenerateReviewFragment extends Fragment {
tvWalletViewKey = view.findViewById(R.id.tvWalletViewKey); tvWalletViewKey = view.findViewById(R.id.tvWalletViewKey);
tvWalletSpendKey = view.findViewById(R.id.tvWalletSpendKey); tvWalletSpendKey = view.findViewById(R.id.tvWalletSpendKey);
tvWalletMnemonic = view.findViewById(R.id.tvWalletMnemonic); tvWalletMnemonic = view.findViewById(R.id.tvWalletMnemonic);
tvWalletHeight = view.findViewById(R.id.tvWalletHeight);
bCopyAddress = view.findViewById(R.id.bCopyAddress); bCopyAddress = view.findViewById(R.id.bCopyAddress);
bAdvancedInfo = view.findViewById(R.id.bAdvancedInfo); bAdvancedInfo = view.findViewById(R.id.bAdvancedInfo);
llAdvancedInfo = view.findViewById(R.id.llAdvancedInfo); llAdvancedInfo = view.findViewById(R.id.llAdvancedInfo);
@@ -188,6 +192,7 @@ public class GenerateReviewFragment extends Fragment {
private class AsyncShow extends AsyncTask<String, Void, Boolean> { private class AsyncShow extends AsyncTask<String, Void, Boolean> {
String name; String name;
String address; String address;
long height;
String seed; String seed;
String viewKey; String viewKey;
String spendKey; String spendKey;
@@ -232,6 +237,7 @@ public class GenerateReviewFragment extends Fragment {
} }
address = wallet.getAddress(); address = wallet.getAddress();
height = wallet.getRestoreHeight();
seed = wallet.getSeed(); seed = wallet.getSeed();
switch (wallet.getDeviceType()) { switch (wallet.getDeviceType()) {
case Device_Ledger: case Device_Ledger:
@@ -264,6 +270,7 @@ public class GenerateReviewFragment extends Fragment {
llPassword.setVisibility(View.VISIBLE); llPassword.setVisibility(View.VISIBLE);
tvWalletPassword.setText(getPassword()); tvWalletPassword.setText(getPassword());
tvWalletAddress.setText(address); tvWalletAddress.setText(address);
tvWalletHeight.setText(NumberFormat.getInstance().format(height));
if (!seed.isEmpty()) { if (!seed.isEmpty()) {
llMnemonic.setVisibility(View.VISIBLE); llMnemonic.setVisibility(View.VISIBLE);
tvWalletMnemonic.setText(seed); tvWalletMnemonic.setText(seed);
@@ -288,6 +295,7 @@ public class GenerateReviewFragment extends Fragment {
} else { } else {
// TODO show proper error message and/or end the fragment? // TODO show proper error message and/or end the fragment?
tvWalletAddress.setText(walletStatus.toString()); tvWalletAddress.setText(walletStatus.toString());
tvWalletHeight.setText(walletStatus.toString());
tvWalletMnemonic.setText(walletStatus.toString()); tvWalletMnemonic.setText(walletStatus.toString());
tvWalletViewKey.setText(walletStatus.toString()); tvWalletViewKey.setText(walletStatus.toString());
tvWalletSpendKey.setText(walletStatus.toString()); tvWalletSpendKey.setText(walletStatus.toString());

View File

@@ -940,8 +940,9 @@ public class LoginActivity extends BaseActivity
@Override @Override
public boolean createWallet(File aFile, String password) { public boolean createWallet(File aFile, String password) {
NodeInfo currentNode = getNode(); NodeInfo currentNode = getNode();
// get it from the connected node if we have one, and go back ca. 4 days
final long restoreHeight = final long restoreHeight =
(currentNode != null) ? currentNode.getHeight() - 20 : -1; (currentNode != null) ? currentNode.getHeight() - 2000 : -1;
Wallet newWallet = WalletManager.getInstance() Wallet newWallet = WalletManager.getInstance()
.createWallet(aFile, password, MNEMONIC_LANGUAGE, restoreHeight); .createWallet(aFile, password, MNEMONIC_LANGUAGE, restoreHeight);
return checkAndCloseWallet(newWallet); return checkAndCloseWallet(newWallet);
@@ -1359,17 +1360,30 @@ public class LoginActivity extends BaseActivity
if (Ledger.ENABLED) if (Ledger.ENABLED)
try { try {
Ledger.connect(usbManager, usbDevice); Ledger.connect(usbManager, usbDevice);
registerDetachReceiver(); if (!Ledger.check()) {
onLedgerAction(); Ledger.disconnect();
runOnUiThread(new Runnable() { runOnUiThread(new Runnable() {
@Override @Override
public void run() { public void run() {
Toast.makeText(LoginActivity.this, Toast.makeText(LoginActivity.this,
getString(R.string.toast_ledger_attached, usbDevice.getProductName()), getString(R.string.toast_ledger_start_app, usbDevice.getProductName()),
Toast.LENGTH_SHORT) Toast.LENGTH_SHORT)
.show(); .show();
} }
}); });
} else {
registerDetachReceiver();
onLedgerAction();
runOnUiThread(new Runnable() {
@Override
public void run() {
Toast.makeText(LoginActivity.this,
getString(R.string.toast_ledger_attached, usbDevice.getProductName()),
Toast.LENGTH_SHORT)
.show();
}
});
}
} catch (IOException ex) { } catch (IOException ex) {
runOnUiThread(new Runnable() { runOnUiThread(new Runnable() {
@Override @Override

View File

@@ -439,10 +439,13 @@ public class LoginFragment extends Fragment implements WalletInfoAdapter.OnInter
} }
Collections.sort(nodesToTest, NodeInfo.BestNodeComparator); Collections.sort(nodesToTest, NodeInfo.BestNodeComparator);
NodeInfo bestNode = nodesToTest.get(0); NodeInfo bestNode = nodesToTest.get(0);
if (bestNode.isValid()) if (bestNode.isValid()) {
activityCallback.setNode(bestNode);
return bestNode; return bestNode;
else } else {
activityCallback.setNode(null);
return null; return null;
}
} }
@Override @Override
@@ -450,7 +453,6 @@ public class LoginFragment extends Fragment implements WalletInfoAdapter.OnInter
if (!isAdded()) return; if (!isAdded()) return;
pbNode.setVisibility(View.INVISIBLE); pbNode.setVisibility(View.INVISIBLE);
llNode.setVisibility(View.VISIBLE); llNode.setVisibility(View.VISIBLE);
activityCallback.setNode(result);
if (result != null) { if (result != null) {
Timber.d("found a good node %s", result.toString()); Timber.d("found a good node %s", result.toString());
showNode(result); showNode(result);

View File

@@ -266,6 +266,7 @@ public class NodeFragment extends Fragment
seedList.add(new NodeInfo(new InetSocketAddress("198.74.231.92", 18080))); seedList.add(new NodeInfo(new InetSocketAddress("198.74.231.92", 18080)));
seedList.add(new NodeInfo(new InetSocketAddress("195.154.123.123", 18080))); seedList.add(new NodeInfo(new InetSocketAddress("195.154.123.123", 18080)));
seedList.add(new NodeInfo(new InetSocketAddress("212.83.172.165", 18080))); seedList.add(new NodeInfo(new InetSocketAddress("212.83.172.165", 18080)));
seedList.add(new NodeInfo(new InetSocketAddress("192.110.160.146", 18080)));
d.seedPeers(seedList); d.seedPeers(seedList);
d.awaitTermination(NODES_TO_FIND); d.awaitTermination(NODES_TO_FIND);
} }

View File

@@ -235,8 +235,10 @@ public class NodeInfo extends Node {
String rpcVersion = json.getString("jsonrpc"); String rpcVersion = json.getString("jsonrpc");
if (!RPC_VERSION.equals(rpcVersion)) if (!RPC_VERSION.equals(rpcVersion))
return false; return false;
final JSONObject header = json.getJSONObject( final JSONObject result = json.getJSONObject("result");
"result").getJSONObject("block_header"); if (!result.has("credits")) // introduced in monero v0.15.0
return false;
final JSONObject header = result.getJSONObject("block_header");
height = header.getLong("height"); height = header.getLong("height");
timestamp = header.getLong("timestamp"); timestamp = header.getLong("timestamp");
majorVersion = header.getInt("major_version"); majorVersion = header.getInt("major_version");

View File

@@ -140,28 +140,12 @@ public class SendAddressWizardFragment extends SendWizardFragment {
next = null; next = null;
} else { } else {
// maybe a bip72 or 70 URI // maybe a bip72 or 70 URI
String bip70 = PaymentProtocolHelper.getBip70(enteredAddress); final String bip70 = PaymentProtocolHelper.getBip70(enteredAddress);
if (bip70 != null) { if (bip70 != null) {
// looks good - resolve through xmr.to // looks good - resolve through xmr.to
processBip70(bip70); 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"); Timber.d("isIntegratedAddress");
etPaymentId.getEditText().getText().clear(); etPaymentId.getEditText().getText().clear();
llPaymentId.setVisibility(View.INVISIBLE); llPaymentId.setVisibility(View.INVISIBLE);
etAddress.setError(getString(R.string.info_paymentid_integrated));
tvPaymentIdIntegrated.setVisibility(View.VISIBLE); tvPaymentIdIntegrated.setVisibility(View.VISIBLE);
llXmrTo.setVisibility(View.INVISIBLE); llXmrTo.setVisibility(View.INVISIBLE);
sendListener.setMode(SendFragment.Mode.XMR); sendListener.setMode(SendFragment.Mode.XMR);
@@ -208,10 +193,21 @@ public class SendAddressWizardFragment extends SendWizardFragment {
if (clip == null) return; if (clip == null) return;
// clean it up // clean it up
final String address = clip.replaceAll("[^0-9A-Z-a-z]", ""); final String address = clip.replaceAll("[^0-9A-Z-a-z]", "");
if (Wallet.isAddressValid(address) || BitcoinAddressValidator.validate(address)) if (Wallet.isAddressValid(address) || BitcoinAddressValidator.validate(address)) {
etAddress.getEditText().setText(address); final EditText et = etAddress.getEditText();
else et.setText(address);
Toast.makeText(getActivity(), getString(R.string.send_address_invalid), Toast.LENGTH_SHORT).show(); et.setSelection(et.getText().length());
etAddress.requestFocus();
} else {
final String bip70 = PaymentProtocolHelper.getBip70(clip);
if (bip70 != null) {
final EditText et = etAddress.getEditText();
et.setText(clip);
et.setSelection(et.getText().length());
processBip70(bip70);
} else
Toast.makeText(getActivity(), getString(R.string.send_address_invalid), Toast.LENGTH_SHORT).show();
}
} }
}); });
@@ -248,7 +244,10 @@ public class SendAddressWizardFragment extends SendWizardFragment {
bPaymentId.setOnClickListener(new View.OnClickListener() { bPaymentId.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { 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 +258,6 @@ public class SendAddressWizardFragment extends SendWizardFragment {
if ((event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER) && (event.getAction() == KeyEvent.ACTION_DOWN)) if ((event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER) && (event.getAction() == KeyEvent.ACTION_DOWN))
|| (actionId == EditorInfo.IME_ACTION_DONE)) { || (actionId == EditorInfo.IME_ACTION_DONE)) {
etDummy.requestFocus(); etDummy.requestFocus();
Helper.hideKeyboard(getActivity());
return true; return true;
} }
return false; return false;
@@ -277,7 +275,6 @@ public class SendAddressWizardFragment extends SendWizardFragment {
etDummy = view.findViewById(R.id.etDummy); etDummy = view.findViewById(R.id.etDummy);
etDummy.setRawInputType(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS); etDummy.setRawInputType(InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS);
etDummy.requestFocus(); etDummy.requestFocus();
Helper.hideKeyboard(getActivity());
View tvNfc = view.findViewById(R.id.tvNfc); View tvNfc = view.findViewById(R.id.tvNfc);
NfcManager manager = (NfcManager) getContext().getSystemService(Context.NFC_SERVICE); NfcManager manager = (NfcManager) getContext().getSystemService(Context.NFC_SERVICE);
@@ -551,7 +548,6 @@ public class SendAddressWizardFragment extends SendWizardFragment {
public void onResumeFragment() { public void onResumeFragment() {
super.onResumeFragment(); super.onResumeFragment();
Timber.d("onResumeFragment()"); Timber.d("onResumeFragment()");
Helper.hideKeyboard(getActivity());
etDummy.requestFocus(); etDummy.requestFocus();
} }

View File

@@ -21,8 +21,6 @@ import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import android.widget.ImageButton; import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView; import android.widget.TextView;
import com.m2049r.xmrwallet.R; 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.data.TxData;
import com.m2049r.xmrwallet.model.Wallet; import com.m2049r.xmrwallet.model.Wallet;
import com.m2049r.xmrwallet.util.Helper; import com.m2049r.xmrwallet.util.Helper;
import com.m2049r.xmrwallet.widget.ExchangeTextView; import com.m2049r.xmrwallet.widget.ExchangeEditText;
import com.m2049r.xmrwallet.widget.NumberPadView;
import timber.log.Timber; import timber.log.Timber;
@@ -59,8 +56,7 @@ public class SendAmountWizardFragment extends SendWizardFragment {
} }
private TextView tvFunds; private TextView tvFunds;
private ExchangeTextView evAmount; private ExchangeEditText etAmount;
private View llAmount;
private View rlSweep; private View rlSweep;
private ImageButton ibSweep; private ImageButton ibSweep;
@@ -75,12 +71,9 @@ public class SendAmountWizardFragment extends SendWizardFragment {
View view = inflater.inflate(R.layout.fragment_send_amount, container, false); View view = inflater.inflate(R.layout.fragment_send_amount, container, false);
tvFunds = view.findViewById(R.id.tvFunds); tvFunds = view.findViewById(R.id.tvFunds);
etAmount = view.findViewById(R.id.etAmount);
evAmount = view.findViewById(R.id.evAmount);
((NumberPadView) view.findViewById(R.id.numberPad)).setListener(evAmount);
rlSweep = view.findViewById(R.id.rlSweep); rlSweep = view.findViewById(R.id.rlSweep);
llAmount = view.findViewById(R.id.llAmount);
view.findViewById(R.id.ivSweep).setOnClickListener(new View.OnClickListener() { view.findViewById(R.id.ivSweep).setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
@@ -97,8 +90,7 @@ public class SendAmountWizardFragment extends SendWizardFragment {
} }
}); });
Helper.hideKeyboard(getActivity()); etAmount.requestFocus();
return view; return view;
} }
@@ -107,11 +99,11 @@ public class SendAmountWizardFragment extends SendWizardFragment {
private void sweepAll(boolean spendAllMode) { private void sweepAll(boolean spendAllMode) {
if (spendAllMode) { if (spendAllMode) {
ibSweep.setVisibility(View.INVISIBLE); ibSweep.setVisibility(View.INVISIBLE);
llAmount.setVisibility(View.GONE); etAmount.setVisibility(View.GONE);
rlSweep.setVisibility(View.VISIBLE); rlSweep.setVisibility(View.VISIBLE);
} else { } else {
ibSweep.setVisibility(View.VISIBLE); ibSweep.setVisibility(View.VISIBLE);
llAmount.setVisibility(View.VISIBLE); etAmount.setVisibility(View.VISIBLE);
rlSweep.setVisibility(View.GONE); rlSweep.setVisibility(View.GONE);
} }
this.spendAllMode = spendAllMode; this.spendAllMode = spendAllMode;
@@ -124,12 +116,12 @@ public class SendAmountWizardFragment extends SendWizardFragment {
sendListener.getTxData().setAmount(Wallet.SWEEP_ALL); sendListener.getTxData().setAmount(Wallet.SWEEP_ALL);
} }
} else { } else {
if (!evAmount.validate(maxFunds)) { if (!etAmount.validate(maxFunds)) {
return false; return false;
} }
if (sendListener != null) { if (sendListener != null) {
String xmr = evAmount.getAmount(); String xmr = etAmount.getAmount();
if (xmr != null) { if (xmr != null) {
sendListener.getTxData().setAmount(Wallet.getAmountFromString(xmr)); sendListener.getTxData().setAmount(Wallet.getAmountFromString(xmr));
} else { } else {
@@ -146,7 +138,7 @@ public class SendAmountWizardFragment extends SendWizardFragment {
public void onResumeFragment() { public void onResumeFragment() {
super.onResumeFragment(); super.onResumeFragment();
Timber.d("onResumeFragment()"); Timber.d("onResumeFragment()");
Helper.hideKeyboard(getActivity()); Helper.showKeyboard(getActivity());
final long funds = getTotalFunds(); final long funds = getTotalFunds();
maxFunds = 1.0 * funds / 1000000000000L; maxFunds = 1.0 * funds / 1000000000000L;
if (!sendListener.getActivityCallback().isStreetMode()) { if (!sendListener.getActivityCallback().isStreetMode()) {
@@ -157,10 +149,10 @@ public class SendAmountWizardFragment extends SendWizardFragment {
getString(R.string.unknown_amount))); getString(R.string.unknown_amount)));
} }
// getAmount is null if exchange is in progress // 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(); final BarcodeData data = sendListener.popBarcodeData();
if ((data != null) && (data.amount != null)) { 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.model.Wallet;
import com.m2049r.xmrwallet.util.Helper; import com.m2049r.xmrwallet.util.Helper;
import com.m2049r.xmrwallet.util.OkHttpHelper; import com.m2049r.xmrwallet.util.OkHttpHelper;
import com.m2049r.xmrwallet.widget.ExchangeBtcTextView; import com.m2049r.xmrwallet.widget.ExchangeBtcEditText;
import com.m2049r.xmrwallet.widget.NumberPadView;
import com.m2049r.xmrwallet.widget.SendProgressView; import com.m2049r.xmrwallet.widget.SendProgressView;
import com.m2049r.xmrwallet.xmrto.XmrToError; import com.m2049r.xmrwallet.xmrto.XmrToError;
import com.m2049r.xmrwallet.xmrto.XmrToException; import com.m2049r.xmrwallet.xmrto.XmrToException;
@@ -62,8 +61,7 @@ public class SendBtcAmountWizardFragment extends SendWizardFragment {
} }
private TextView tvFunds; private TextView tvFunds;
private ExchangeBtcTextView evAmount; private ExchangeBtcEditText etAmount;
private NumberPadView numberPad;
private TextView tvXmrToParms; private TextView tvXmrToParms;
private SendProgressView evParams; private SendProgressView evParams;
@@ -86,24 +84,20 @@ public class SendBtcAmountWizardFragment extends SendWizardFragment {
tvXmrToParms = view.findViewById(R.id.tvXmrToParms); tvXmrToParms = view.findViewById(R.id.tvXmrToParms);
evAmount = view.findViewById(R.id.evAmount); etAmount = view.findViewById(R.id.etAmount);
numberPad = view.findViewById(R.id.numberPad); etAmount.requestFocus();
numberPad.setListener(evAmount);
Helper.hideKeyboard(getActivity());
return view; return view;
} }
@Override @Override
public boolean onValidateFields() { public boolean onValidateFields() {
if (!evAmount.validate(maxBtc, minBtc)) { if (!etAmount.validate(maxBtc, minBtc)) {
return false; return false;
} }
if (sendListener != null) { if (sendListener != null) {
TxDataBtc txDataBtc = (TxDataBtc) sendListener.getTxData(); TxDataBtc txDataBtc = (TxDataBtc) sendListener.getTxData();
String btcString = evAmount.getAmount(); String btcString = etAmount.getAmount();
if (btcString != null) { if (btcString != null) {
try { try {
double btc = Double.parseDouble(btcString); double btc = Double.parseDouble(btcString);
@@ -122,10 +116,12 @@ public class SendBtcAmountWizardFragment extends SendWizardFragment {
private void setBip70Mode() { private void setBip70Mode() {
TxDataBtc txDataBtc = (TxDataBtc) sendListener.getTxData(); TxDataBtc txDataBtc = (TxDataBtc) sendListener.getTxData();
if (txDataBtc.getBip70() != null) { if (txDataBtc.getBip70() == null) {
numberPad.setVisibility(View.INVISIBLE); etAmount.setEditable(true);
Helper.showKeyboard(getActivity());
} else { } else {
numberPad.setVisibility(View.VISIBLE); etAmount.setEditable(false);
Helper.hideKeyboard(getActivity());
} }
} }
@@ -141,7 +137,6 @@ public class SendBtcAmountWizardFragment extends SendWizardFragment {
public void onResumeFragment() { public void onResumeFragment() {
super.onResumeFragment(); super.onResumeFragment();
Timber.d("onResumeFragment()"); Timber.d("onResumeFragment()");
Helper.hideKeyboard(getActivity());
final long funds = getTotalFunds(); final long funds = getTotalFunds();
if (!sendListener.getActivityCallback().isStreetMode()) { if (!sendListener.getActivityCallback().isStreetMode()) {
tvFunds.setText(getString(R.string.send_available, tvFunds.setText(getString(R.string.send_available,
@@ -153,7 +148,7 @@ public class SendBtcAmountWizardFragment extends SendWizardFragment {
final BarcodeData data = sendListener.popBarcodeData(); final BarcodeData data = sendListener.popBarcodeData();
if (data != null) { if (data != null) {
if (data.amount != null) { if (data.amount != null) {
evAmount.setAmount(data.amount); etAmount.setAmount(data.amount);
} }
} }
setBip70Mode(); setBip70Mode();
@@ -171,7 +166,7 @@ public class SendBtcAmountWizardFragment extends SendWizardFragment {
getView().post(new Runnable() { getView().post(new Runnable() {
@Override @Override
public void run() { public void run() {
evAmount.setRate(1.0d / orderParameters.getPrice()); etAmount.setRate(1.0d / orderParameters.getPrice());
NumberFormat df = NumberFormat.getInstance(Locale.US); NumberFormat df = NumberFormat.getInstance(Locale.US);
df.setMaximumFractionDigits(6); df.setMaximumFractionDigits(6);
String min = df.format(orderParameters.getLowerLimit()); String min = df.format(orderParameters.getLowerLimit());
@@ -211,7 +206,7 @@ public class SendBtcAmountWizardFragment extends SendWizardFragment {
} }
private void processOrderParmsError(final Exception ex) { private void processOrderParmsError(final Exception ex) {
evAmount.setRate(0); etAmount.setRate(0);
orderParameters = null; orderParameters = null;
maxBtc = 0; maxBtc = 0;
minBtc = 0; minBtc = 0;

View File

@@ -134,6 +134,10 @@ public enum Instruction {
return value; return value;
} }
public byte getByteValue() {
return (byte) (value & 0xFF);
}
private int value; private int value;
Instruction(int value) { Instruction(int value) {

View File

@@ -27,9 +27,11 @@ import com.btchip.BTChipException;
import com.btchip.comm.BTChipTransport; import com.btchip.comm.BTChipTransport;
import com.btchip.comm.android.BTChipTransportAndroidHID; import com.btchip.comm.android.BTChipTransportAndroidHID;
import com.m2049r.xmrwallet.BuildConfig; import com.m2049r.xmrwallet.BuildConfig;
import com.m2049r.xmrwallet.model.WalletManager;
import com.m2049r.xmrwallet.util.Helper; import com.m2049r.xmrwallet.util.Helper;
import java.io.IOException; import java.io.IOException;
import java.nio.charset.StandardCharsets;
import timber.log.Timber; import timber.log.Timber;
@@ -40,9 +42,11 @@ public class Ledger {
static public final int LOOKAHEAD_SUBADDRESSES = 20; static public final int LOOKAHEAD_SUBADDRESSES = 20;
static public final String SUBADDRESS_LOOKAHEAD = LOOKAHEAD_ACCOUNTS + ":" + LOOKAHEAD_SUBADDRESSES; static public final String SUBADDRESS_LOOKAHEAD = LOOKAHEAD_ACCOUNTS + ":" + LOOKAHEAD_SUBADDRESSES;
private static final byte PROTOCOL_VERSION = 0x02;
public static final int SW_OK = 0x9000; public static final int SW_OK = 0x9000;
public static final int SW_INS_NOT_SUPPORTED = 0x6D00; public static final int SW_INS_NOT_SUPPORTED = 0x6D00;
public static final int OK[] = {SW_OK}; public static final int OK[] = {SW_OK};
public static final int MINIMUM_LEDGER_VERSION = (1 << 16) + (3 << 8) + (1); // 1.3.1
public static UsbDevice findDevice(UsbManager usbManager) { public static UsbDevice findDevice(UsbManager usbManager) {
if (!ENABLED) return null; if (!ENABLED) return null;
@@ -89,6 +93,21 @@ public class Ledger {
} }
} }
static public boolean check() {
if (Instance == null) return false;
byte[] moneroVersion = WalletManager.moneroVersion().getBytes(StandardCharsets.US_ASCII);
try {
byte[] resp = Instance.exchangeApduNoOpt(Instruction.INS_RESET, moneroVersion, OK);
int deviceVersion = (resp[0] << 16) + (resp[1] << 8) + (resp[2]);
if (deviceVersion < MINIMUM_LEDGER_VERSION)
return false;
} catch (BTChipException ex) { // comm error - probably wrong app started on device
return false;
}
return true;
}
final private BTChipTransport transport; final private BTChipTransport transport;
final private String name; final private String name;
private int lastSW = 0; private int lastSW = 0;
@@ -112,7 +131,7 @@ public class Ledger {
synchronized private byte[] exchangeRaw(byte[] apdu) { synchronized private byte[] exchangeRaw(byte[] apdu) {
if (transport == null) if (transport == null)
throw new IllegalStateException("No transport (probably closed previously)"); throw new IllegalStateException("No transport (probably closed previously)");
Timber.i("exchangeRaw %02x", apdu[1]); Timber.d("exchangeRaw %02x", apdu[1]);
Instruction ins = Instruction.fromByte(apdu[1]); Instruction ins = Instruction.fromByte(apdu[1]);
if (listener != null) listener.onInstructionSend(ins, apdu); if (listener != null) listener.onInstructionSend(ins, apdu);
sniffOut(ins, apdu); sniffOut(ins, apdu);
@@ -120,7 +139,6 @@ public class Ledger {
if (listener != null) listener.onInstructionReceive(ins, data); if (listener != null) listener.onInstructionReceive(ins, data);
sniffIn(data); sniffIn(data);
return data; return data;
} }
private byte[] exchange(byte[] apdu) throws BTChipException { private byte[] exchange(byte[] apdu) throws BTChipException {
@@ -148,68 +166,19 @@ public class Ledger {
throw new BTChipException("Invalid status", lastSW); throw new BTChipException("Invalid status", lastSW);
} }
private byte[] exchangeApdu(byte cla, byte ins, byte p1, byte p2, byte[] data, int acceptedSW[]) throws BTChipException { private byte[] exchangeApduNoOpt(Instruction instruction, byte[] data, int acceptedSW[])
byte[] apdu = new byte[data.length + 5]; throws BTChipException {
apdu[0] = cla; byte[] apdu = new byte[data.length + 6];
apdu[1] = ins; apdu[0] = PROTOCOL_VERSION;
apdu[2] = p1; apdu[1] = instruction.getByteValue();
apdu[3] = p2; apdu[2] = 0; // p1
apdu[4] = (byte) (data.length); apdu[3] = 0; // p2
System.arraycopy(data, 0, apdu, 5, data.length); apdu[4] = (byte) (data.length + 1); // +1 because the opt byte is part of the data
apdu[5] = 0; // opt
System.arraycopy(data, 0, apdu, 6, data.length);
return exchangeCheck(apdu, acceptedSW); return exchangeCheck(apdu, acceptedSW);
} }
private byte[] exchangeApdu(byte cla, byte ins, byte p1, byte p2, int length, int acceptedSW[]) throws BTChipException {
byte[] apdu = new byte[5];
apdu[0] = cla;
apdu[1] = ins;
apdu[2] = p1;
apdu[3] = p2;
apdu[4] = (byte) (length);
return exchangeCheck(apdu, acceptedSW);
}
private byte[] exchangeApduSplit(byte cla, byte ins, byte p1, byte p2, byte[] data, int acceptedSW[]) throws BTChipException {
int offset = 0;
byte[] result = null;
while (offset < data.length) {
int blockLength = ((data.length - offset) > 255 ? 255 : data.length - offset);
byte[] apdu = new byte[blockLength + 5];
apdu[0] = cla;
apdu[1] = ins;
apdu[2] = p1;
apdu[3] = p2;
apdu[4] = (byte) (blockLength);
System.arraycopy(data, offset, apdu, 5, blockLength);
result = exchangeCheck(apdu, acceptedSW);
offset += blockLength;
}
return result;
}
private byte[] exchangeApduSplit2(byte cla, byte ins, byte p1, byte p2, byte[] data, byte[] data2, int acceptedSW[]) throws BTChipException {
int offset = 0;
byte[] result = null;
int maxBlockSize = 255 - data2.length;
while (offset < data.length) {
int blockLength = ((data.length - offset) > maxBlockSize ? maxBlockSize : data.length - offset);
boolean lastBlock = ((offset + blockLength) == data.length);
byte[] apdu = new byte[blockLength + 5 + (lastBlock ? data2.length : 0)];
apdu[0] = cla;
apdu[1] = ins;
apdu[2] = p1;
apdu[3] = p2;
apdu[4] = (byte) (blockLength + (lastBlock ? data2.length : 0));
System.arraycopy(data, offset, apdu, 5, blockLength);
if (lastBlock) {
System.arraycopy(data2, 0, apdu, 5 + blockLength, data2.length);
}
result = exchangeCheck(apdu, acceptedSW);
offset += blockLength;
}
return result;
}
public interface Listener { public interface Listener {
void onInstructionSend(Instruction ins, byte[] apdu); void onInstructionSend(Instruction ins, byte[] apdu);
@@ -251,7 +220,6 @@ public class Ledger {
if (ins == Instruction.INS_GET_KEY) { if (ins == Instruction.INS_GET_KEY) {
snoopKey = (apdu[2] == 2); snoopKey = (apdu[2] == 2);
} }
} }
private void sniffIn(byte[] data) { private void sniffIn(byte[] data) {

View File

@@ -354,4 +354,6 @@ public class WalletManager {
static public native void logWarning(String category, String message); static public native void logWarning(String category, String message);
static public native void logError(String category, String message); static public native void logError(String category, String message);
static public native String moneroVersion();
} }

View File

@@ -290,7 +290,7 @@ public class WalletService extends Service {
showProgress(10); showProgress(10);
Wallet.Status walletStatus = start(walletId, walletPw); Wallet.Status walletStatus = start(walletId, walletPw);
if (observer != null) observer.onWalletStarted(walletStatus); if (observer != null) observer.onWalletStarted(walletStatus);
if (!walletStatus.isOk()) { if ((walletStatus == null) || !walletStatus.isOk()) {
errorState = true; errorState = true;
stop(); stop();
} }

View File

@@ -103,6 +103,8 @@ public class RestoreHeight {
blockheight.put("2019-03-01", 1781681L); blockheight.put("2019-03-01", 1781681L);
blockheight.put("2019-04-01", 1803081L); blockheight.put("2019-04-01", 1803081L);
blockheight.put("2019-05-01", 1824671L); blockheight.put("2019-05-01", 1824671L);
blockheight.put("2019-06-01", 1847005L);
blockheight.put("2019-07-01", 1868590L);
} }
public long getHeight(String date) { public long getHeight(String date) {

View File

@@ -19,9 +19,12 @@
package com.m2049r.xmrwallet.widget; package com.m2049r.xmrwallet.widget;
import android.content.Context; import android.content.Context;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.AttributeSet; import android.util.AttributeSet;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.widget.ArrayAdapter; import android.widget.ArrayAdapter;
import android.widget.EditText;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.Spinner; import android.widget.Spinner;
import android.widget.TextView; import android.widget.TextView;
@@ -31,8 +34,7 @@ import com.m2049r.xmrwallet.util.Helper;
import timber.log.Timber; import timber.log.Timber;
public class ExchangeBtcTextView extends LinearLayout public class ExchangeBtcEditText extends LinearLayout {
implements NumberPadView.NumberPadListener {
String btcAmount = null; String btcAmount = null;
String xmrAmount = null; String xmrAmount = null;
@@ -67,7 +69,7 @@ public class ExchangeBtcTextView extends LinearLayout
} }
void shakeAmountField() { void shakeAmountField() {
tvAmountA.startAnimation(Helper.getShakeAnimation(getContext())); etAmountA.startAnimation(Helper.getShakeAnimation(getContext()));
} }
void shakeExchangeField() { void shakeExchangeField() {
@@ -86,31 +88,35 @@ public class ExchangeBtcTextView extends LinearLayout
public void setAmount(String btcAmount) { public void setAmount(String btcAmount) {
this.btcAmount = btcAmount; this.btcAmount = btcAmount;
tvAmountA.setText(btcAmount); etAmountA.setText(btcAmount);
xmrAmount = null; xmrAmount = null;
exchange(); exchange();
} }
public void setEditable(boolean editable) {
etAmountA.setEnabled(editable);
}
public String getAmount() { public String getAmount() {
return btcAmount; return btcAmount;
} }
TextView tvAmountA; EditText etAmountA;
TextView tvAmountB; TextView tvAmountB;
Spinner sCurrencyA; Spinner sCurrencyA;
Spinner sCurrencyB; Spinner sCurrencyB;
public ExchangeBtcTextView(Context context) { public ExchangeBtcEditText(Context context) {
super(context); super(context);
initializeViews(context); initializeViews(context);
} }
public ExchangeBtcTextView(Context context, AttributeSet attrs) { public ExchangeBtcEditText(Context context, AttributeSet attrs) {
super(context, attrs); super(context, attrs);
initializeViews(context); initializeViews(context);
} }
public ExchangeBtcTextView(Context context, public ExchangeBtcEditText(Context context,
AttributeSet attrs, AttributeSet attrs,
int defStyle) { int defStyle) {
super(context, attrs, defStyle); super(context, attrs, defStyle);
@@ -125,13 +131,28 @@ public class ExchangeBtcTextView extends LinearLayout
private void initializeViews(Context context) { private void initializeViews(Context context) {
LayoutInflater inflater = (LayoutInflater) context LayoutInflater inflater = (LayoutInflater) context
.getSystemService(Context.LAYOUT_INFLATER_SERVICE); .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
inflater.inflate(R.layout.view_exchange_btc_text, this); inflater.inflate(R.layout.view_exchange_btc_edit, this);
} }
@Override @Override
protected void onFinishInflate() { protected void onFinishInflate() {
super.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); tvAmountB = findViewById(R.id.tvAmountB);
sCurrencyA = findViewById(R.id.sCurrencyA); sCurrencyA = findViewById(R.id.sCurrencyA);
sCurrencyB = findViewById(R.id.sCurrencyB); sCurrencyB = findViewById(R.id.sCurrencyB);
@@ -146,12 +167,14 @@ public class ExchangeBtcTextView extends LinearLayout
new String[]{"XMR"}); new String[]{"XMR"});
sCurrencyB.setAdapter(xmrAdapter); sCurrencyB.setAdapter(xmrAdapter);
sCurrencyB.setEnabled(false); sCurrencyB.setEnabled(false);
etAmountA.setFocusable(true);
etAmountA.setFocusableInTouchMode(true);
} }
double xmrBtcRate = 0; double xmrBtcRate = 0;
public void exchange() { public void exchange() {
btcAmount = tvAmountA.getText().toString(); btcAmount = etAmountA.getText().toString();
if (!btcAmount.isEmpty() && (xmrBtcRate > 0)) { if (!btcAmount.isEmpty() && (xmrBtcRate > 0)) {
double xmr = xmrBtcRate * Double.parseDouble(btcAmount); double xmr = xmrBtcRate * Double.parseDouble(btcAmount);
xmrAmount = Helper.getFormattedAmount(xmr, true); 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)); tvAmountB.setText(getResources().getString(R.string.send_amount_btc_xmr, xmrAmount));
Timber.d("%s BTC =%f> %s XMR", btcAmount, xmrBtcRate, 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.content.Context;
import android.os.Handler; import android.os.Handler;
import android.os.Looper; import android.os.Looper;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.AttributeSet; import android.util.AttributeSet;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.widget.AdapterView; import android.widget.AdapterView;
import android.widget.ImageButton; import android.widget.EditText;
import android.widget.ImageView; import android.widget.ImageView;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.ProgressBar; import android.widget.ProgressBar;
@@ -43,10 +45,7 @@ import java.util.Locale;
import timber.log.Timber; import timber.log.Timber;
public class ExchangeTextView extends LinearLayout public class ExchangeEditText extends LinearLayout {
implements NumberPadView.NumberPadListener {
private static String MAX = "\u221E";
String xmrAmount = null; String xmrAmount = null;
String notXmrAmount = null; String notXmrAmount = null;
@@ -89,7 +88,7 @@ public class ExchangeTextView extends LinearLayout
} }
void shakeAmountField() { void shakeAmountField() {
tvAmountA.startAnimation(Helper.getShakeAnimation(getContext())); etAmountA.startAnimation(Helper.getShakeAnimation(getContext()));
} }
void shakeExchangeField() { void shakeExchangeField() {
@@ -99,7 +98,7 @@ public class ExchangeTextView extends LinearLayout
public void setAmount(String xmrAmount) { public void setAmount(String xmrAmount) {
if (xmrAmount != null) { if (xmrAmount != null) {
setCurrencyA(0); setCurrencyA(0);
tvAmountA.setText(xmrAmount); etAmountA.setText(xmrAmount);
setXmr(xmrAmount); setXmr(xmrAmount);
this.notXmrAmount = null; this.notXmrAmount = null;
doExchange(); doExchange();
@@ -114,7 +113,7 @@ public class ExchangeTextView extends LinearLayout
return xmrAmount; return xmrAmount;
} }
TextView tvAmountA; EditText etAmountA;
TextView tvAmountB; TextView tvAmountB;
Spinner sCurrencyA; Spinner sCurrencyA;
Spinner sCurrencyB; Spinner sCurrencyB;
@@ -146,17 +145,17 @@ public class ExchangeTextView extends LinearLayout
return sCurrencyB.getSelectedItemPosition(); return sCurrencyB.getSelectedItemPosition();
} }
public ExchangeTextView(Context context) { public ExchangeEditText(Context context) {
super(context); super(context);
initializeViews(context); initializeViews(context);
} }
public ExchangeTextView(Context context, AttributeSet attrs) { public ExchangeEditText(Context context, AttributeSet attrs) {
super(context, attrs); super(context, attrs);
initializeViews(context); initializeViews(context);
} }
public ExchangeTextView(Context context, public ExchangeEditText(Context context,
AttributeSet attrs, AttributeSet attrs,
int defStyle) { int defStyle) {
super(context, attrs, defStyle); super(context, attrs, defStyle);
@@ -171,13 +170,28 @@ public class ExchangeTextView extends LinearLayout
private void initializeViews(Context context) { private void initializeViews(Context context) {
LayoutInflater inflater = (LayoutInflater) context LayoutInflater inflater = (LayoutInflater) context
.getSystemService(Context.LAYOUT_INFLATER_SERVICE); .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
inflater.inflate(R.layout.view_exchange_text, this); inflater.inflate(R.layout.view_exchange_edit, this);
} }
@Override @Override
protected void onFinishInflate() { protected void onFinishInflate() {
super.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); tvAmountB = findViewById(R.id.tvAmountB);
sCurrencyA = findViewById(R.id.sCurrencyA); sCurrencyA = findViewById(R.id.sCurrencyA);
sCurrencyB = findViewById(R.id.sCurrencyB); sCurrencyB = findViewById(R.id.sCurrencyB);
@@ -317,7 +331,7 @@ public class ExchangeTextView extends LinearLayout
boolean prepareExchange() { boolean prepareExchange() {
Timber.d("prepareExchange()"); Timber.d("prepareExchange()");
String enteredAmount = tvAmountA.getText().toString(); String enteredAmount = etAmountA.getText().toString();
if (!enteredAmount.isEmpty()) { if (!enteredAmount.isEmpty()) {
String cleanAmount = ""; String cleanAmount = "";
if (getCurrencyA() == 0) { if (getCurrencyA() == 0) {
@@ -426,37 +440,4 @@ public class ExchangeTextView extends LinearLayout
public void setOnFailedExchangeListener(OnFailedExchangeListener listener) { public void setOnFailedExchangeListener(OnFailedExchangeListener listener) {
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; import timber.log.Timber;
// TODO combine this with ExchangeTextView public class ExchangeView extends LinearLayout {
String xmrAmount = null;
public class ExchangeView extends LinearLayout String notXmrAmount = null;
implements NumberPadView.NumberPadListener {
public void enableSoftKeyboard(final boolean isEnabled) {
etAmount.getEditText().setShowSoftInputOnFocus(isEnabled);
}
public boolean focus() {
return etAmount.requestFocus();
}
public void enable(boolean enable) { public void enable(boolean enable) {
etAmount.setEnabled(enable); etAmount.setEnabled(enable);
@@ -67,9 +58,6 @@ public class ExchangeView extends LinearLayout
sCurrencyB.setEnabled(enable); sCurrencyB.setEnabled(enable);
} }
String xmrAmount = null;
String notXmrAmount = null;
void setXmr(String xmr) { void setXmr(String xmr) {
xmrAmount = xmr; xmrAmount = xmr;
if (onNewAmountListener != null) { if (onNewAmountListener != null) {
@@ -482,31 +470,4 @@ public class ExchangeView extends LinearLayout
public void setOnFailedExchangeListener(OnFailedExchangeListener listener) { public void setOnFailedExchangeListener(OnFailedExchangeListener listener) {
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

@@ -18,11 +18,13 @@
<android.support.design.widget.TextInputLayout <android.support.design.widget.TextInputLayout
android:id="@+id/etWalletName" android:id="@+id/etWalletName"
style="@style/Widget.MaterialComponents.TextInputLayout.FilledBox"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
app:counterEnabled="true" app:counterEnabled="true"
app:counterMaxLength="20" app:counterMaxLength="20"
android:layout_marginEnd="4dp"
app:errorEnabled="true"> app:errorEnabled="true">
<android.support.design.widget.TextInputEditText <android.support.design.widget.TextInputEditText
@@ -39,7 +41,9 @@
<android.support.design.widget.TextInputLayout <android.support.design.widget.TextInputLayout
android:id="@+id/etWalletPassword" android:id="@+id/etWalletPassword"
style="@style/Widget.MaterialComponents.TextInputLayout.FilledBox"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_marginStart="4dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1"> android:layout_weight="1">
@@ -78,6 +82,7 @@
<android.support.design.widget.TextInputLayout <android.support.design.widget.TextInputLayout
android:id="@+id/etWalletMnemonic" android:id="@+id/etWalletMnemonic"
style="@style/Widget.MaterialComponents.TextInputLayout.FilledBox"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:visibility="gone" android:visibility="gone"
@@ -95,6 +100,7 @@
<android.support.design.widget.TextInputLayout <android.support.design.widget.TextInputLayout
android:id="@+id/etWalletAddress" android:id="@+id/etWalletAddress"
style="@style/Widget.MaterialComponents.TextInputLayout.FilledBox"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:visibility="gone" android:visibility="gone"
@@ -115,6 +121,7 @@
<android.support.design.widget.TextInputLayout <android.support.design.widget.TextInputLayout
android:id="@+id/etWalletViewKey" android:id="@+id/etWalletViewKey"
style="@style/Widget.MaterialComponents.TextInputLayout.FilledBox"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:visibility="gone" android:visibility="gone"
@@ -134,6 +141,7 @@
<android.support.design.widget.TextInputLayout <android.support.design.widget.TextInputLayout
android:id="@+id/etWalletSpendKey" android:id="@+id/etWalletSpendKey"
style="@style/Widget.MaterialComponents.TextInputLayout.FilledBox"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:visibility="gone" android:visibility="gone"
@@ -153,6 +161,7 @@
<android.support.design.widget.TextInputLayout <android.support.design.widget.TextInputLayout
android:id="@+id/etWalletRestoreHeight" android:id="@+id/etWalletRestoreHeight"
style="@style/Widget.MaterialComponents.TextInputLayout.FilledBox"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:visibility="gone" android:visibility="gone"

View File

@@ -84,16 +84,17 @@
android:id="@+id/evAmount" android:id="@+id/evAmount"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="16dp"
android:layout_marginTop="16dp" android:layout_marginTop="16dp"
android:layout_marginBottom="16dp"
android:orientation="vertical" /> android:orientation="vertical" />
<android.support.design.widget.TextInputLayout <android.support.design.widget.TextInputLayout
android:id="@+id/etNotes" android:id="@+id/etNotes"
style="@style/Widget.MaterialComponents.TextInputLayout.FilledBox"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<EditText <android.support.design.widget.TextInputEditText
style="@style/MoneroEdit" style="@style/MoneroEdit"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@@ -101,7 +102,6 @@
android:imeOptions="actionDone" android:imeOptions="actionDone"
android:inputType="textMultiLine" android:inputType="textMultiLine"
android:textAlignment="textStart" /> android:textAlignment="textStart" />
</android.support.design.widget.TextInputLayout> </android.support.design.widget.TextInputLayout>
<RelativeLayout <RelativeLayout
@@ -128,8 +128,8 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_gravity="center"
android:drawablePadding="4dp"
android:drawableStart="@drawable/ic_info_outline_gray_24dp" android:drawableStart="@drawable/ic_info_outline_gray_24dp"
android:drawablePadding="4dp"
android:text="@string/label_receive_info_gen_qr_code" android:text="@string/label_receive_info_gen_qr_code"
android:textAlignment="center" android:textAlignment="center"
android:textSize="16sp" android:textSize="16sp"
@@ -149,8 +149,8 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentBottom="true" android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:drawablePadding="8dp"
android:drawableStart="@drawable/ic_nfc_black_24dp" android:drawableStart="@drawable/ic_nfc_black_24dp"
android:drawablePadding="8dp"
android:gravity="center" android:gravity="center"
android:text="@string/nfc_tag_tap" android:text="@string/nfc_tag_tap"
android:visibility="visible" /> android:visibility="visible" />

View File

@@ -77,6 +77,32 @@
tools:text="tucks slackens vehicle doctor oaks aloof balding knife rays wise haggled cuisine navy ladder suitcase dusted last thorn pixels karate ticket nibs violin zapped slackens" /> tools:text="tucks slackens vehicle doctor oaks aloof balding knife rays wise haggled cuisine navy ladder suitcase dusted last thorn pixels karate ticket nibs violin zapped slackens" />
</LinearLayout> </LinearLayout>
<LinearLayout
android:id="@+id/llHeight"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/data_top"
android:orientation="vertical"
android:visibility="visible">
<TextView
style="@style/MoneroLabel.Heading"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center"
android:text="@string/label_restoreheight" />
<TextView
android:id="@+id/tvWalletHeight"
style="@style/MoneroText.Monospace.Mnemonic"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/data_top"
android:background="@drawable/backgound_seed"
android:textAlignment="center"
tools:text="1,878,151" />
</LinearLayout>
<LinearLayout <LinearLayout
android:id="@+id/llPassword" android:id="@+id/llPassword"
android:layout_width="match_parent" android:layout_width="match_parent"

View File

@@ -29,6 +29,7 @@
android:orientation="horizontal"> android:orientation="horizontal">
<android.support.design.widget.TextInputLayout <android.support.design.widget.TextInputLayout
style="@style/Widget.MaterialComponents.TextInputLayout.FilledBox"
android:id="@+id/etAddress" android:id="@+id/etAddress"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@@ -75,7 +76,7 @@
android:drawableStart="@drawable/ic_check_gray_24dp" android:drawableStart="@drawable/ic_check_gray_24dp"
android:drawablePadding="8dp" android:drawablePadding="8dp"
android:gravity="center" android:gravity="center"
android:text="@string/info_paymentid_intergrated" android:text="@string/info_paymentid_integrated"
android:textSize="18sp" android:textSize="18sp"
android:visibility="invisible" /> android:visibility="invisible" />
@@ -118,6 +119,7 @@
android:visibility="visible"> android:visibility="visible">
<android.support.design.widget.TextInputLayout <android.support.design.widget.TextInputLayout
style="@style/Widget.MaterialComponents.TextInputLayout.FilledBox"
android:id="@+id/etPaymentId" android:id="@+id/etPaymentId"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@@ -153,11 +155,12 @@
</FrameLayout> </FrameLayout>
<android.support.design.widget.TextInputLayout <android.support.design.widget.TextInputLayout
style="@style/Widget.MaterialComponents.TextInputLayout.FilledBox"
android:id="@+id/etNotes" android:id="@+id/etNotes"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
<EditText <android.support.design.widget.TextInputEditText
style="@style/MoneroEdit" style="@style/MoneroEdit"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"

View File

@@ -27,35 +27,19 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
android:paddingEnd="12dp"
android:paddingStart="12dp" android:paddingStart="12dp"
android:paddingEnd="12dp"
android:src="@drawable/ic_all_inclusive_24dp" android:src="@drawable/ic_all_inclusive_24dp"
android:visibility="visible" /> android:visibility="visible" />
</RelativeLayout> </RelativeLayout>
<LinearLayout <com.m2049r.xmrwallet.widget.ExchangeEditText
android:id="@+id/llAmount" android:id="@+id/etAmount"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:orientation="vertical" android:layout_marginTop="16dp"
android:visibility="visible"> android:layout_marginBottom="16dp"
android:orientation="vertical" />
<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>
<RelativeLayout <RelativeLayout
android:id="@+id/rlSweep" android:id="@+id/rlSweep"

View File

@@ -53,19 +53,11 @@
</LinearLayout> </LinearLayout>
</FrameLayout> </FrameLayout>
<com.m2049r.xmrwallet.widget.ExchangeBtcTextView <com.m2049r.xmrwallet.widget.ExchangeBtcEditText
android:id="@+id/evAmount" android:id="@+id/etAmount"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginBottom="16dp" android:layout_marginBottom="16dp"
android:layout_marginTop="16dp" android:layout_marginTop="16dp"
android:orientation="vertical" /> 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> </LinearLayout>

View File

@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@@ -225,14 +226,20 @@
android:padding="8sp" android:padding="8sp"
android:text="@string/tx_notes" /> android:text="@string/tx_notes" />
<EditText <android.support.design.widget.TextInputLayout
android:id="@+id/etTxNotes" style="@style/Widget.MaterialComponents.TextInputLayout.FilledBox"
style="@style/MoneroEdit" android:layout_width="match_parent"
android:layout_width="wrap_content" android:layout_height="wrap_content">
android:layout_height="wrap_content"
android:backgroundTint="@color/moneroGray" <android.support.design.widget.TextInputEditText
android:hint="@string/tx_notes_hint" android:id="@+id/etTxNotes"
android:inputType="textMultiLine" /> style="@style/MoneroEdit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:backgroundTint="@color/moneroGray"
android:hint="@string/tx_notes_hint"
android:inputType="textMultiLine" />
</android.support.design.widget.TextInputLayout>
</TableRow> </TableRow>
<TableRow> <TableRow>

View File

@@ -15,6 +15,7 @@
android:layout_centerInParent="true" android:layout_centerInParent="true"
android:layout_marginStart="8dp" android:layout_marginStart="8dp"
android:layout_marginEnd="8dp" android:layout_marginEnd="8dp"
android:padding="12dp"
android:background="?android:attr/selectableItemBackgroundBorderless" android:background="?android:attr/selectableItemBackgroundBorderless"
android:gravity="center" android:gravity="center"
android:src="@drawable/ic_bookmark_border_24dp" /> android:src="@drawable/ic_bookmark_border_24dp" />
@@ -24,6 +25,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentTop="true" android:layout_alignParentTop="true"
android:layout_centerInParent="true"
android:layout_margin="8dp" android:layout_margin="8dp"
android:layout_toStartOf="@+id/ivPing" android:layout_toStartOf="@+id/ivPing"
android:layout_toEndOf="@id/ibBookmark" android:layout_toEndOf="@id/ibBookmark"

View File

@@ -12,6 +12,7 @@
<android.support.design.widget.TextInputLayout <android.support.design.widget.TextInputLayout
android:id="@+id/etWalletPasswordA" android:id="@+id/etWalletPasswordA"
style="@style/Widget.MaterialComponents.TextInputLayout.FilledBox"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:errorEnabled="true"> app:errorEnabled="true">
@@ -28,6 +29,7 @@
<android.support.design.widget.TextInputLayout <android.support.design.widget.TextInputLayout
android:id="@+id/etWalletPasswordB" android:id="@+id/etWalletPasswordB"
style="@style/Widget.MaterialComponents.TextInputLayout.FilledBox"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/section_top" android:layout_marginTop="@dimen/section_top"

View File

@@ -8,8 +8,8 @@
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_marginStart="16dp" android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginEnd="16dp" android:layout_marginEnd="16dp"
android:orientation="vertical"> android:orientation="vertical">
@@ -22,6 +22,7 @@
<android.support.design.widget.TextInputLayout <android.support.design.widget.TextInputLayout
android:id="@+id/etNodeHost" android:id="@+id/etNodeHost"
style="@style/Widget.MaterialComponents.TextInputLayout.FilledBox"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="8" android:layout_weight="8"
@@ -41,6 +42,7 @@
<android.support.design.widget.TextInputLayout <android.support.design.widget.TextInputLayout
android:id="@+id/etNodePort" android:id="@+id/etNodePort"
style="@style/Widget.MaterialComponents.TextInputLayout.FilledBox"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="2" android:layout_weight="2"
@@ -61,6 +63,7 @@
<android.support.design.widget.TextInputLayout <android.support.design.widget.TextInputLayout
android:id="@+id/etNodeName" android:id="@+id/etNodeName"
style="@style/Widget.MaterialComponents.TextInputLayout.FilledBox"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/data_top"> android:layout_marginTop="@dimen/data_top">
@@ -85,6 +88,7 @@
<android.support.design.widget.TextInputLayout <android.support.design.widget.TextInputLayout
android:id="@+id/etNodeUser" android:id="@+id/etNodeUser"
style="@style/Widget.MaterialComponents.TextInputLayout.FilledBox"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1"> android:layout_weight="1">
@@ -103,6 +107,7 @@
<android.support.design.widget.TextInputLayout <android.support.design.widget.TextInputLayout
android:id="@+id/etNodePass" android:id="@+id/etNodePass"
style="@style/Widget.MaterialComponents.TextInputLayout.FilledBox"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1"> android:layout_weight="1">
@@ -142,8 +147,8 @@
style="@style/MoneroText.Medium" style="@style/MoneroText.Medium"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="4dp"
android:layout_alignBaseline="@+id/tvResultLabel" android:layout_alignBaseline="@+id/tvResultLabel"
android:layout_marginStart="4dp"
android:layout_toEndOf="@+id/tvResultLabel" android:layout_toEndOf="@+id/tvResultLabel"
android:textAlignment="textStart" android:textAlignment="textStart"
tools:text="Blockheight: 1710998 (v9), Ping: 187ms" /> tools:text="Blockheight: 1710998 (v9), Ping: 187ms" />

Some files were not shown because too many files have changed in this diff Show More