From cf4d8bdbf0b18403c299b4c27d71bcbf0c36966c Mon Sep 17 00:00:00 2001
From: m2049r <30435443+m2049r@users.noreply.github.com>
Date: Sat, 9 Sep 2017 09:34:44 +0200
Subject: [PATCH] fix unconfirmed display
---
.../com/m2049r/xmrwallet/WalletFragment.java | 2 +-
.../com/m2049r/xmrwallet/util/Helper.java | 20 +++++++++++++------
app/src/main/res/values/strings.xml | 2 +-
3 files changed, 16 insertions(+), 8 deletions(-)
diff --git a/app/src/main/java/com/m2049r/xmrwallet/WalletFragment.java b/app/src/main/java/com/m2049r/xmrwallet/WalletFragment.java
index 961e4e71..5a837e97 100644
--- a/app/src/main/java/com/m2049r/xmrwallet/WalletFragment.java
+++ b/app/src/main/java/com/m2049r/xmrwallet/WalletFragment.java
@@ -194,7 +194,7 @@ public class WalletFragment extends Fragment implements TransactionInfoAdapter.O
long balance = wallet.getBalance();
long unlockedBalance = wallet.getUnlockedBalance();
tvBalance.setText(getResources().getString(R.string.xmr_balance, Helper.getDisplayAmount(unlockedBalance)));
- tvUnconfirmedAmount.setText(getResources().getString(R.string.xmr_balance, Helper.getDisplayAmount(balance - unlockedBalance)));
+ tvUnconfirmedAmount.setText(getResources().getString(R.string.xmr_unconfirmed_amount, Helper.getDisplayAmount(balance - unlockedBalance)));
String sync = "";
if (!activityCallback.hasBoundService())
throw new IllegalStateException("WalletService not bound.");
diff --git a/app/src/main/java/com/m2049r/xmrwallet/util/Helper.java b/app/src/main/java/com/m2049r/xmrwallet/util/Helper.java
index e3fdee3e..23458cb6 100644
--- a/app/src/main/java/com/m2049r/xmrwallet/util/Helper.java
+++ b/app/src/main/java/com/m2049r/xmrwallet/util/Helper.java
@@ -38,10 +38,18 @@ import com.m2049r.xmrwallet.model.Wallet;
import com.m2049r.xmrwallet.model.WalletManager;
import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.net.HttpURLConnection;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import javax.net.ssl.HttpsURLConnection;
public class Helper {
- private static final String TAG = "Helper";
- private static final String WALLET_DIR = "Monerujo";
+ static private final String TAG = "Helper";
+ static private final String WALLET_DIR = "Monerujo";
static public File getStorageRoot(Context context) {
if (!isExternalStorageWritable()) {
@@ -62,7 +70,7 @@ public class Helper {
return dir;
}
- public static final int PERMISSIONS_REQUEST_WRITE_EXTERNAL_STORAGE = 1;
+ static public final int PERMISSIONS_REQUEST_WRITE_EXTERNAL_STORAGE = 1;
static public boolean getWritePermission(Activity context) {
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M) {
@@ -80,7 +88,7 @@ public class Helper {
}
}
- public static final int PERMISSIONS_REQUEST_CAMERA = 1;
+ static public final int PERMISSIONS_REQUEST_CAMERA = 1;
static public boolean getCameraPermission(Activity context) {
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M) {
@@ -165,7 +173,7 @@ public class Helper {
return s.substring(0, cutoff);
}
- public static Bitmap getBitmap(Context context, int drawableId) {
+ static public Bitmap getBitmap(Context context, int drawableId) {
Drawable drawable = ContextCompat.getDrawable(context, drawableId);
if (drawable instanceof BitmapDrawable) {
return BitmapFactory.decodeResource(context.getResources(), drawableId);
@@ -176,7 +184,7 @@ public class Helper {
}
}
- private static Bitmap getBitmap(VectorDrawable vectorDrawable) {
+ static private Bitmap getBitmap(VectorDrawable vectorDrawable) {
Bitmap bitmap = Bitmap.createBitmap(vectorDrawable.getIntrinsicWidth(),
vectorDrawable.getIntrinsicHeight(), Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(bitmap);
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 727b8af0..74e50ab1 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -58,7 +58,7 @@
Amount
Date
- + %1$s unconfirmed
+ p+ %1$s unconfirmed
%1$s XMR
Transactions
Daemon connected!