Bugfix: Display of unconfirmed amount (#51)

* fix unconfirmed display

* fix unconfirmed display
This commit is contained in:
m2049r 2017-09-09 12:22:24 +02:00 committed by GitHub
parent 7b690a5086
commit 08a62cabab
3 changed files with 16 additions and 9 deletions

View File

@ -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.");

View File

@ -35,13 +35,20 @@ import android.view.inputmethod.InputMethodManager;
import com.m2049r.xmrwallet.R;
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 +69,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 +87,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 +172,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 +183,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);

View File

@ -58,7 +58,7 @@
<string name="title_amount">Amount</string>
<string name="title_date">Date</string>
<string name="xmr_unconfirmed_amount">+ %1$s unconfirmed</string>
<string name="xmr_unconfirmed_amount">p+ %1$s unconfirmed</string>
<string name="xmr_balance">%1$s XMR</string>
<string name="label_transactions">Transactions</string>
<string name="text_daemonConnected">Daemon connected!</string>