From e39cd1c988d48eb83888649bd3baa54895fb0650 Mon Sep 17 00:00:00 2001 From: m2049r <30435443+m2049r@users.noreply.github.com> Date: Tue, 29 Aug 2017 21:35:23 +0200 Subject: [PATCH 1/2] lots of GUI tweaks --- .../xmrwallet/GenerateReviewFragment.java | 1 + .../java/com/m2049r/xmrwallet/TxFragment.java | 14 +- .../com/m2049r/xmrwallet/WalletActivity.java | 1 + .../layout/TransactionInfoAdapter.java | 31 ++-- .../main/res/layout/gen_review_fragment.xml | 39 ----- app/src/main/res/layout/login_fragment.xml | 2 +- app/src/main/res/layout/send_fragment.xml | 8 + app/src/main/res/layout/transaction_item.xml | 146 ++++++++---------- app/src/main/res/layout/wallet_fragment.xml | 5 +- app/src/main/res/values/colors.xml | 3 +- app/src/main/res/values/strings.xml | 2 +- 11 files changed, 103 insertions(+), 149 deletions(-) diff --git a/app/src/main/java/com/m2049r/xmrwallet/GenerateReviewFragment.java b/app/src/main/java/com/m2049r/xmrwallet/GenerateReviewFragment.java index 9c2dcd87..0f84fcbd 100644 --- a/app/src/main/java/com/m2049r/xmrwallet/GenerateReviewFragment.java +++ b/app/src/main/java/com/m2049r/xmrwallet/GenerateReviewFragment.java @@ -65,6 +65,7 @@ public class GenerateReviewFragment extends Fragment { boolean testnet = WalletManager.getInstance().isTestNet(); tvWalletMnemonic.setTextIsSelectable(testnet); + tvWalletSpendKey.setTextIsSelectable(testnet); bAccept.setOnClickListener(new View.OnClickListener() { @Override diff --git a/app/src/main/java/com/m2049r/xmrwallet/TxFragment.java b/app/src/main/java/com/m2049r/xmrwallet/TxFragment.java index bb259f4a..9c40ec05 100644 --- a/app/src/main/java/com/m2049r/xmrwallet/TxFragment.java +++ b/app/src/main/java/com/m2049r/xmrwallet/TxFragment.java @@ -50,7 +50,7 @@ public class TxFragment extends Fragment { static public final String ARG_INFO = "info"; - private final SimpleDateFormat TS_FORMATTER = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + private final SimpleDateFormat TS_FORMATTER = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss Z"); public TxFragment() { super(); @@ -146,10 +146,10 @@ public class TxFragment extends Fragment { sb.append(getString(R.string.tx_timestamp)).append(": "); sb.append(TS_FORMATTER.format(new Date(info.timestamp * 1000))).append("\n"); sb.append(getString(R.string.tx_blockheight)).append(": "); - if (info.isPending) { - sb.append(getString(R.string.tx_pending)).append("\n"); - } else if (info.isFailed) { + if (info.isFailed) { sb.append(getString(R.string.tx_failed)).append("\n"); + } else if (info.isPending) { + sb.append(getString(R.string.tx_pending)).append("\n"); } else { sb.append(info.blockheight).append("\n"); } @@ -196,10 +196,10 @@ public class TxFragment extends Fragment { tvTxId.setText(info.hash); tvTxKey.setText(info.txKey.isEmpty() ? "-" : info.txKey); tvTxPaymentId.setText(info.paymentId); - if (info.isPending) { - tvTxBlockheight.setText(getString(R.string.tx_pending)); - } else if (info.isFailed) { + if (info.isFailed) { tvTxBlockheight.setText(getString(R.string.tx_failed)); + } else if (info.isPending) { + tvTxBlockheight.setText(getString(R.string.tx_pending)); } else { tvTxBlockheight.setText("" + info.blockheight); } diff --git a/app/src/main/java/com/m2049r/xmrwallet/WalletActivity.java b/app/src/main/java/com/m2049r/xmrwallet/WalletActivity.java index a3a1aabd..e7511131 100644 --- a/app/src/main/java/com/m2049r/xmrwallet/WalletActivity.java +++ b/app/src/main/java/com/m2049r/xmrwallet/WalletActivity.java @@ -332,6 +332,7 @@ public class WalletActivity extends AppCompatActivity implements WalletFragment. final WalletFragment walletFragment = (WalletFragment) getFragmentManager().findFragmentById(R.id.fragment_container); if (wallet.isSynchronized()) { + Log.d(TAG, "onRefreshed() synced"); releaseWakeLock(); // the idea is to stay awake until synced if (!synced) { onProgress(null); diff --git a/app/src/main/java/com/m2049r/xmrwallet/layout/TransactionInfoAdapter.java b/app/src/main/java/com/m2049r/xmrwallet/layout/TransactionInfoAdapter.java index 83db9c6a..3b8dc54e 100644 --- a/app/src/main/java/com/m2049r/xmrwallet/layout/TransactionInfoAdapter.java +++ b/app/src/main/java/com/m2049r/xmrwallet/layout/TransactionInfoAdapter.java @@ -40,8 +40,7 @@ import java.util.TimeZone; public class TransactionInfoAdapter extends RecyclerView.Adapter { private static final String TAG = "TransactionInfoAdapter"; - private final SimpleDateFormat DATE_FORMATTER = new SimpleDateFormat("yyyy-MM-dd"); - private final SimpleDateFormat TIME_FORMATTER = new SimpleDateFormat("HH:mm:ss"); + private final SimpleDateFormat DATETIME_FORMATTER = new SimpleDateFormat("yyyy-MM-dd HH:mm"); static final int TX_RED = Color.rgb(255, 79, 65); static final int TX_GREEN = Color.rgb(54, 176, 91); @@ -60,8 +59,7 @@ public class TransactionInfoAdapter extends RecyclerView.Adapterb2) { + if (b1 > b2) { return -1; - } else if (b1 - - - - - -