mirror of
https://github.com/wownero/wownerujo.git
synced 2026-11-22 00:03:58 +01:00
Rework of Send flow + refactoring (#146)
This commit is contained in:
@@ -32,6 +32,8 @@ import android.graphics.drawable.VectorDrawable;
|
||||
import android.os.Environment;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.view.WindowManager;
|
||||
import android.view.animation.Animation;
|
||||
import android.view.animation.AnimationUtils;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
|
||||
import com.m2049r.xmrwallet.R;
|
||||
@@ -53,7 +55,6 @@ public class Helper {
|
||||
static private final String WALLET_DIR = "monerujo";
|
||||
|
||||
static public int DISPLAY_DIGITS_INFO = 5;
|
||||
static public int DISPLAY_DIGITS_SHORT = 5;
|
||||
|
||||
static public File getStorageRoot(Context context) {
|
||||
if (!isExternalStorageWritable()) {
|
||||
@@ -92,7 +93,7 @@ public class Helper {
|
||||
}
|
||||
}
|
||||
|
||||
static public final int PERMISSIONS_REQUEST_CAMERA = 1;
|
||||
static public final int PERMISSIONS_REQUEST_CAMERA = 7;
|
||||
|
||||
static public boolean getCameraPermission(Activity context) {
|
||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M) {
|
||||
@@ -174,9 +175,14 @@ public class Helper {
|
||||
static public String getFormattedAmount(double amount, boolean isXmr) {
|
||||
// at this point selection is XMR in case of error
|
||||
String displayB;
|
||||
if (isXmr) { // not XMR
|
||||
displayB = String.format(Locale.US, "%,.5f", amount);
|
||||
} else { // XMR
|
||||
if (isXmr) { // XMR
|
||||
long xmr = Wallet.getAmountFromDouble(amount);
|
||||
if ((xmr > 0) || (amount == 0)) {
|
||||
displayB = String.format(Locale.US, "%,.5f", amount);
|
||||
} else {
|
||||
displayB = null;
|
||||
}
|
||||
} else { // not XMR
|
||||
displayB = String.format(Locale.US, "%,.2f", amount);
|
||||
}
|
||||
return displayB;
|
||||
@@ -241,4 +247,17 @@ public class Helper {
|
||||
clipboardManager.setPrimaryClip(clip);
|
||||
}
|
||||
|
||||
static private Animation ShakeAnimation;
|
||||
|
||||
static public Animation getShakeAnimation(Context context) {
|
||||
if (ShakeAnimation == null) {
|
||||
synchronized (Helper.class) {
|
||||
if (ShakeAnimation == null) {
|
||||
ShakeAnimation = AnimationUtils.loadAnimation(context, R.anim.shake);
|
||||
}
|
||||
}
|
||||
}
|
||||
return ShakeAnimation;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user