From 7b19e9a2bd8329f2175481fb16caf625a01c1bd5 Mon Sep 17 00:00:00 2001 From: m2049r <30435443+m2049r@users.noreply.github.com> Date: Sat, 18 Nov 2017 10:19:16 +0100 Subject: [PATCH 1/3] wider amount field with % left/right padding --- app/src/main/res/layout/fragment_receive.xml | 30 +++++++++++++++----- app/src/main/res/layout/fragment_send.xml | 30 +++++++++++++++----- 2 files changed, 46 insertions(+), 14 deletions(-) diff --git a/app/src/main/res/layout/fragment_receive.xml b/app/src/main/res/layout/fragment_receive.xml index 1770f0d..04665cf 100644 --- a/app/src/main/res/layout/fragment_receive.xml +++ b/app/src/main/res/layout/fragment_receive.xml @@ -46,15 +46,31 @@ android:textAlignment="center" tools:text="9wZnnNctRc7RaLya1rxykH21dUwfQpNGmVLjAvkvqe7nKT2Mw848AJNGMunW5xjoSZ5vCCU3uDnUoVqSSHxzRtQBE3f6crx" /> - + android:orientation="horizontal" + android:weightSum="12"> + + + + + + + - + android:orientation="horizontal" + android:weightSum="12"> + + + + + + + Date: Sat, 18 Nov 2017 11:04:34 +0100 Subject: [PATCH 2/3] qr code is now a button --- .../com/m2049r/xmrwallet/ReceiveFragment.java | 19 +++++----- app/src/main/res/layout/fragment_receive.xml | 36 +++++++++++-------- app/src/main/res/values/strings.xml | 2 ++ 3 files changed, 34 insertions(+), 23 deletions(-) diff --git a/app/src/main/java/com/m2049r/xmrwallet/ReceiveFragment.java b/app/src/main/java/com/m2049r/xmrwallet/ReceiveFragment.java index cc99725..73ea881 100644 --- a/app/src/main/java/com/m2049r/xmrwallet/ReceiveFragment.java +++ b/app/src/main/java/com/m2049r/xmrwallet/ReceiveFragment.java @@ -64,8 +64,8 @@ public class ReceiveFragment extends Fragment { private TextInputLayout etPaymentId; private ExchangeView evAmount; private Button bPaymentId; - private Button bGenerate; - private ImageView qrCode; + private TextView tvQrCode; + private ImageButton qrCode; private EditText etDummy; private ImageButton bCopyAddress; @@ -90,8 +90,8 @@ public class ReceiveFragment extends Fragment { etPaymentId = (TextInputLayout) view.findViewById(R.id.etPaymentId); evAmount = (ExchangeView) view.findViewById(R.id.evAmount); bPaymentId = (Button) view.findViewById(R.id.bPaymentId); - qrCode = (ImageView) view.findViewById(R.id.qrCode); - bGenerate = (Button) view.findViewById(R.id.bGenerate); + qrCode = (ImageButton) view.findViewById(R.id.qrCode); + tvQrCode = (TextView) view.findViewById(R.id.tvQrCode); etDummy = (EditText) view.findViewById(R.id.etDummy); bCopyAddress = (ImageButton) view.findViewById(R.id.bCopyAddress); @@ -160,7 +160,7 @@ public class ReceiveFragment extends Fragment { } }); - bGenerate.setOnClickListener(new View.OnClickListener() { + qrCode.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (checkPaymentId()) { @@ -195,14 +195,16 @@ public class ReceiveFragment extends Fragment { void clearQR() { if (qrValid) { - qrCode.setImageBitmap(getMoneroLogo()); + qrCode.setImageBitmap(null); qrValid = false; + tvQrCode.setVisibility(View.VISIBLE); } } void setQR(Bitmap qr) { qrCode.setImageBitmap(qr); qrValid = true; + tvQrCode.setVisibility(View.INVISIBLE); Helper.hideKeyboard(getActivity()); etDummy.requestFocus(); } @@ -221,9 +223,7 @@ public class ReceiveFragment extends Fragment { listenerCallback.setTitle(name); tvAddress.setText(address); etPaymentId.setEnabled(true); - //etAmount.setEnabled(true); bPaymentId.setEnabled(true); - bGenerate.setEnabled(true); bCopyAddress.setEnabled(true); bCopyAddress.setImageResource(R.drawable.ic_content_copy_black_24dp); hideProgress(); @@ -307,7 +307,8 @@ public class ReceiveFragment extends Fragment { sb.append(ScannerFragment.QR_AMOUNT).append('=').append(xmrAmount); } String text = sb.toString(); - Bitmap qr = generate(text, 500, 500); + int size = Math.min(qrCode.getHeight(), qrCode.getWidth()); + Bitmap qr = generate(text, size, size); if (qr != null) { setQR(qr); Log.d(TAG, "SETQR"); diff --git a/app/src/main/res/layout/fragment_receive.xml b/app/src/main/res/layout/fragment_receive.xml index 04665cf..309189a 100644 --- a/app/src/main/res/layout/fragment_receive.xml +++ b/app/src/main/res/layout/fragment_receive.xml @@ -114,22 +114,30 @@ -