mirror of
https://github.com/m2049r/xmrwallet
synced 2025-09-05 09:58:42 +02:00
Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
e076c19e3e | ||
![]() |
35b717756d | ||
![]() |
c14486306e | ||
![]() |
c2ef25c377 | ||
![]() |
b7164ef200 |
@@ -7,8 +7,8 @@ android {
|
||||
applicationId "com.m2049r.xmrwallet"
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 28
|
||||
versionCode 197
|
||||
versionName "1.12.7 'Caerbannog'"
|
||||
versionCode 199
|
||||
versionName "1.12.9 'Caerbannog'"
|
||||
|
||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||
externalNativeBuild {
|
||||
|
@@ -50,6 +50,7 @@ import com.m2049r.xmrwallet.widget.Toolbar;
|
||||
|
||||
import java.text.NumberFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import timber.log.Timber;
|
||||
@@ -112,9 +113,12 @@ public class WalletFragment extends Fragment
|
||||
ivSynced = view.findViewById(R.id.ivSynced);
|
||||
|
||||
sCurrency = view.findViewById(R.id.sCurrency);
|
||||
ArrayAdapter currencyAdapter = ArrayAdapter.createFromResource(getContext(), R.array.currency, R.layout.item_spinner_balance);
|
||||
currencyAdapter.setDropDownViewResource(R.layout.item_spinner_dropdown_item);
|
||||
sCurrency.setAdapter(currencyAdapter);
|
||||
List<String> currencies = new ArrayList<>();
|
||||
currencies.add(Helper.BASE_CRYPTO);
|
||||
currencies.addAll(Arrays.asList(getResources().getStringArray(R.array.currency)));
|
||||
ArrayAdapter<String> spinnerAdapter = new ArrayAdapter<>(getContext(), R.layout.item_spinner_balance, currencies);
|
||||
spinnerAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
|
||||
sCurrency.setAdapter(spinnerAdapter);
|
||||
|
||||
bSend = view.findViewById(R.id.bSend);
|
||||
bReceive = view.findViewById(R.id.bReceive);
|
||||
|
@@ -227,6 +227,7 @@ public class Helper {
|
||||
return String.format(Locale.US, "%,.2f", amount);
|
||||
else { // amount < 1
|
||||
int decimals = 1 - (int) Math.floor(Math.log10(amount));
|
||||
if (decimals < 2) decimals = 2;
|
||||
if (decimals > 12) decimals = 12;
|
||||
return String.format(Locale.US, "%,." + decimals + "f", amount);
|
||||
}
|
||||
|
@@ -44,6 +44,7 @@ import com.m2049r.xmrwallet.util.Helper;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import timber.log.Timber;
|
||||
|
||||
@@ -66,9 +67,9 @@ public class ExchangeEditText extends LinearLayout {
|
||||
return false;
|
||||
}
|
||||
boolean ok = true;
|
||||
String enteredAmount = etAmountA.getText().toString();
|
||||
String nativeAmount = getNativeAmount();
|
||||
try {
|
||||
double amount = Double.parseDouble(enteredAmount);
|
||||
double amount = Double.parseDouble(nativeAmount);
|
||||
if ((amount < min) || (amount > max)) {
|
||||
ok = false;
|
||||
}
|
||||
@@ -110,7 +111,7 @@ public class ExchangeEditText extends LinearLayout {
|
||||
|
||||
public String getNativeAmount() {
|
||||
if (isExchangeInProgress()) return null;
|
||||
if (sCurrencyA.getSelectedItemPosition() == 0)
|
||||
if (getCurrencyA() == 0)
|
||||
return getCleanAmountString(etAmountA.getText().toString());
|
||||
else
|
||||
return getCleanAmountString(tvAmountB.getText().toString());
|
||||
@@ -336,7 +337,7 @@ public class ExchangeEditText extends LinearLayout {
|
||||
private void exchange(double rate) {
|
||||
double amount = getEnteredAmount();
|
||||
if (rate > 0) {
|
||||
tvAmountB.setText(Helper.getFormattedAmount(rate * amount));
|
||||
tvAmountB.setText(Helper.getFormattedAmount(rate * amount, getCurrencyB() == 0));
|
||||
} else {
|
||||
tvAmountB.setText(null);
|
||||
Timber.w("No rate!");
|
||||
@@ -347,7 +348,7 @@ public class ExchangeEditText extends LinearLayout {
|
||||
try {
|
||||
double amount = Double.parseDouble(enteredAmount);
|
||||
if (amount >= 0) {
|
||||
return Helper.getFormattedAmount(amount);
|
||||
return String.format(Locale.US, "%,.12f", amount);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
@@ -275,7 +275,7 @@
|
||||
<string name="receive_amount_hint">Quantitat</string>
|
||||
<string name="receive_desc_hint">Descripció (opcional)</string>
|
||||
<string name="receive_cannot_open">No s\'ha pogut obrir el portamonedes!</string>
|
||||
<string name="receive_paymentid_invalid">16 or 64 Hex caràcters (0–9,a–f)</string>
|
||||
<string name="receive_paymentid_invalid">16 Hex caràcters (0–9,a–f)</string>
|
||||
<string name="receive_integrated_paymentid_invalid">ha d\'estar buit amb una adreça integrada</string>
|
||||
|
||||
<string name="receive_amount_too_big">Màx. %1$s</string>
|
||||
|
@@ -269,7 +269,7 @@
|
||||
|
||||
<string name="receive_amount_hint">Betrag</string>
|
||||
<string name="receive_cannot_open">Konnte Wallet nicht öffnen!</string>
|
||||
<string name="receive_paymentid_invalid">16 oder 64 Hex-Zeichen (0–9,a–f)</string>
|
||||
<string name="receive_paymentid_invalid">16 Hex-Zeichen (0–9,a–f)</string>
|
||||
<string name="receive_integrated_paymentid_invalid">Muss bei einer integrierten Adresse leer sein</string>
|
||||
|
||||
<string name="receive_amount_too_big">Max. %1$s</string>
|
||||
|
@@ -243,7 +243,7 @@
|
||||
|
||||
<string name="receive_amount_hint">Ποσό</string>
|
||||
<string name="receive_cannot_open">Δεν ήταν δυνατό το άνοιγμα του πορτοφολιού!</string>
|
||||
<string name="receive_paymentid_invalid">16 ή 64 χαρακτήρες Hex (0–9,a–f)</string>
|
||||
<string name="receive_paymentid_invalid">16 χαρακτήρες Hex (0–9,a–f)</string>
|
||||
<string name="receive_integrated_paymentid_invalid">Πρέπει να είναι άδειο με ενσωματωμένη διεύθυνση</string>
|
||||
|
||||
<string name="receive_amount_too_big">Μέγιστο %1$s</string>
|
||||
|
@@ -275,7 +275,7 @@
|
||||
<string name="receive_amount_hint">Kvanto</string>
|
||||
<string name="receive_desc_hint">Priskribo (opcia)</string>
|
||||
<string name="receive_cannot_open">Ne sukcesis malfermi la monujon!</string>
|
||||
<string name="receive_paymentid_invalid">16 aŭ 64 deksesumaj signoj (0–9,a–f)</string>
|
||||
<string name="receive_paymentid_invalid">16 deksesumaj signoj (0–9,a–f)</string>
|
||||
<string name="receive_integrated_paymentid_invalid">Tio restu malplena kiam integrita adreso uziĝas</string>
|
||||
|
||||
<string name="receive_amount_too_big">Maks. %1$s</string>
|
||||
|
@@ -204,7 +204,7 @@
|
||||
|
||||
<string name="receive_amount_hint">Monto</string>
|
||||
<string name="receive_cannot_open">¡No se ha podido abrir el monedero!</string>
|
||||
<string name="receive_paymentid_invalid">16 o 64 caracteres hexadecimales (0–9,a–f)</string>
|
||||
<string name="receive_paymentid_invalid">16 caracteres hexadecimales (0–9,a–f)</string>
|
||||
<string name="receive_integrated_paymentid_invalid">Debe estar vacío con una dirección integrada</string>
|
||||
|
||||
<string name="receive_amount_too_big">Max. %1$s</string>
|
||||
|
@@ -270,7 +270,7 @@
|
||||
<string name="receive_amount_hint">Kogus</string>
|
||||
<string name="receive_desc_hint">Kommentaarid (valikuline)</string>
|
||||
<string name="receive_cannot_open">Rahakotti ei õnnestunud avada!</string>
|
||||
<string name="receive_paymentid_invalid">16 või 64 Hex tähemärgid (0–9,a–f)</string>
|
||||
<string name="receive_paymentid_invalid">16 Hex tähemärgid (0–9,a–f)</string>
|
||||
<string name="receive_integrated_paymentid_invalid">Peab olema tühi koos integreeritud aadressiga</string>
|
||||
|
||||
<string name="receive_amount_too_big">Kuni %1$s</string>
|
||||
|
@@ -271,7 +271,7 @@
|
||||
|
||||
<string name="receive_amount_hint">Montant</string>
|
||||
<string name="receive_cannot_open">Ouverture du portefeuille impossible !</string>
|
||||
<string name="receive_paymentid_invalid">16 ou 64 caractères héxadécimaux (0–9,a–f)</string>
|
||||
<string name="receive_paymentid_invalid">16 caractères héxadécimaux (0–9,a–f)</string>
|
||||
<string name="receive_integrated_paymentid_invalid">Doit être vide avec une adresse intégrée</string>
|
||||
|
||||
<string name="receive_amount_too_big">Max. %1$s</string>
|
||||
|
@@ -268,7 +268,7 @@
|
||||
|
||||
<string name="receive_amount_hint">Mennyiség</string>
|
||||
<string name="receive_cannot_open">Nem sikerült megnyitni a tárcát!</string>
|
||||
<string name="receive_paymentid_invalid">16 vagy 64 hexadecimális karakter (0–9,a–f)</string>
|
||||
<string name="receive_paymentid_invalid">16 hexadecimális karakter (0–9,a–f)</string>
|
||||
<string name="receive_integrated_paymentid_invalid">Integrált cím esetén üresnek kell lennie</string>
|
||||
|
||||
<string name="receive_amount_too_big">Max. %1$s</string>
|
||||
|
@@ -270,7 +270,7 @@
|
||||
|
||||
<string name="receive_amount_hint">Ammontare</string>
|
||||
<string name="receive_cannot_open">Impossibile aprire il portafoglio!</string>
|
||||
<string name="receive_paymentid_invalid">16 o 64 caratteri esadecimali (0–9,a–f)</string>
|
||||
<string name="receive_paymentid_invalid">16 caratteri esadecimali (0–9,a–f)</string>
|
||||
<string name="receive_integrated_paymentid_invalid">Deve essere vuoto con un indirizzo integrato</string>
|
||||
|
||||
<string name="receive_amount_too_big">Max. %1$s</string>
|
||||
|
@@ -276,7 +276,7 @@
|
||||
<string name="receive_amount_hint">数量</string>
|
||||
<string name="receive_desc_hint">説明 (オプション)</string>
|
||||
<string name="receive_cannot_open">ウォレットを開けませんでした!</string>
|
||||
<string name="receive_paymentid_invalid">16 または 64 文字の16進数 (0–9,a–f)</string>
|
||||
<string name="receive_paymentid_invalid">16 文字の16進数 (0–9,a–f)</string>
|
||||
<string name="receive_integrated_paymentid_invalid">インテグレーテッドアドレスでは空でなければなりません</string>
|
||||
|
||||
<string name="receive_amount_too_big">最大. %1$s</string>
|
||||
|
@@ -268,7 +268,7 @@
|
||||
|
||||
<string name="receive_amount_hint">Mengde</string>
|
||||
<string name="receive_cannot_open">Kunne ikke åpne lommebok!</string>
|
||||
<string name="receive_paymentid_invalid">16 eller 64 heks-karakterer (0–9,a–f)</string>
|
||||
<string name="receive_paymentid_invalid">16 heks-karakterer (0–9,a–f)</string>
|
||||
<string name="receive_integrated_paymentid_invalid">Må være tom med integrert adresse</string>
|
||||
|
||||
<string name="receive_amount_too_big">Maks. %1$s</string>
|
||||
|
@@ -265,7 +265,7 @@
|
||||
|
||||
<string name="receive_amount_hint">Bedrag</string>
|
||||
<string name="receive_cannot_open">Kan portemonnee niet openen!</string>
|
||||
<string name="receive_paymentid_invalid">16 of 64 hexadecimale tekens (0–9, a–f)</string>
|
||||
<string name="receive_paymentid_invalid">16 hexadecimale tekens (0–9, a–f)</string>
|
||||
<string name="receive_integrated_paymentid_invalid">Moet leeg zijn bij een geïntegreerd adres</string>
|
||||
|
||||
<string name="receive_amount_too_big">Max. %1$s</string>
|
||||
|
@@ -267,7 +267,7 @@
|
||||
|
||||
<string name="receive_amount_hint">Valor</string>
|
||||
<string name="receive_cannot_open">Não foi possível abrir a carteira!</string>
|
||||
<string name="receive_paymentid_invalid">16 ou 64 caracteres em hexadecimal (0–9,a–f)</string>
|
||||
<string name="receive_paymentid_invalid">16 caracteres em hexadecimal (0–9,a–f)</string>
|
||||
<string name="receive_integrated_paymentid_invalid">Deve estar vazio ao usar endereços integrados</string>
|
||||
|
||||
<string name="receive_amount_too_big">Máx. %1$s</string>
|
||||
|
@@ -267,7 +267,7 @@
|
||||
|
||||
<string name="receive_amount_hint">Quantidade</string>
|
||||
<string name="receive_cannot_open">Não foi possível abrir a carteira!</string>
|
||||
<string name="receive_paymentid_invalid">16 ou 64 caracteres em hexadecimal (0–9,a–f)</string>
|
||||
<string name="receive_paymentid_invalid">16 caracteres em hexadecimal (0–9,a–f)</string>
|
||||
<string name="receive_integrated_paymentid_invalid">Tem que estar vazio com endereços integrados</string>
|
||||
|
||||
<string name="receive_amount_too_big">Max. %1$s</string>
|
||||
|
@@ -243,7 +243,7 @@
|
||||
|
||||
<string name="receive_amount_hint">Sumă</string>
|
||||
<string name="receive_cannot_open">Nu pot deschide portofel!</string>
|
||||
<string name="receive_paymentid_invalid">16 sau 64 caractere Hex (0–9,a–f)</string>
|
||||
<string name="receive_paymentid_invalid">16 caractere Hex (0–9,a–f)</string>
|
||||
<string name="receive_integrated_paymentid_invalid">Trebuie să fie gol cu adresă integrată</string>
|
||||
|
||||
<string name="receive_amount_too_big">Max. %1$s</string>
|
||||
|
@@ -269,7 +269,7 @@
|
||||
|
||||
<string name="receive_amount_hint">Сумма</string>
|
||||
<string name="receive_cannot_open">Не удалось открыть кошелек!</string>
|
||||
<string name="receive_paymentid_invalid">Система счисления - 16 или 64(0–9,a–f)</string>
|
||||
<string name="receive_paymentid_invalid">Система счисления - 16 (0–9,a–f)</string>
|
||||
<string name="receive_integrated_paymentid_invalid">Должно быть пустым со встроенным адресом</string>
|
||||
|
||||
<string name="receive_amount_too_big">Max. %1$s</string>
|
||||
|
@@ -266,7 +266,7 @@
|
||||
|
||||
<string name="receive_amount_hint">Suma</string>
|
||||
<string name="receive_cannot_open">Nemohol som otvoriť peňaženku!</string>
|
||||
<string name="receive_paymentid_invalid">16 alebo 64 hexa znakov (0–9,a–f)</string>
|
||||
<string name="receive_paymentid_invalid">16 hexa znakov (0–9,a–f)</string>
|
||||
<string name="receive_integrated_paymentid_invalid">Musí byť prázdna s integrovanou adresou</string>
|
||||
|
||||
<string name="receive_amount_too_big">Max. %1$s</string>
|
||||
|
@@ -277,7 +277,7 @@
|
||||
<string name="receive_amount_hint">Suma</string>
|
||||
<string name="receive_desc_hint">Opis (opciono)</string>
|
||||
<string name="receive_cannot_open">Nemoguće otvaranje novčanika!</string>
|
||||
<string name="receive_paymentid_invalid">16 ili 64 heks. znakova (0–9,a–f)</string>
|
||||
<string name="receive_paymentid_invalid">16 heks. znakova (0–9,a–f)</string>
|
||||
<string name="receive_integrated_paymentid_invalid">Mora biti prazno sa integrisanom adresom</string>
|
||||
|
||||
<string name="receive_amount_too_big">Maks. %1$s</string>
|
||||
|
@@ -249,7 +249,7 @@
|
||||
|
||||
<string name="receive_amount_hint">Belopp</string>
|
||||
<string name="receive_cannot_open">Det gick inte att öppna plånboken!</string>
|
||||
<string name="receive_paymentid_invalid">16 eller 64 hexadecimala tecken (0–9, a–f)</string>
|
||||
<string name="receive_paymentid_invalid">16 hexadecimala tecken (0–9, a–f)</string>
|
||||
<string name="receive_integrated_paymentid_invalid">Måste vara tomt med en integrerad adress</string>
|
||||
|
||||
<string name="receive_amount_too_big">Max. %1$s</string>
|
||||
|
@@ -269,7 +269,7 @@
|
||||
|
||||
<string name="receive_amount_hint">Сума</string>
|
||||
<string name="receive_cannot_open">Не вдалося відкрити гаманець!</string>
|
||||
<string name="receive_paymentid_invalid">Система зчислення - 16 или 64(0–9,a–f)</string>
|
||||
<string name="receive_paymentid_invalid">Система зчислення - 16 (0–9,a–f)</string>
|
||||
<string name="receive_integrated_paymentid_invalid">Повинно бути порожнім при використанні інтегрованої адреси</string>
|
||||
|
||||
<string name="receive_amount_too_big">Max. %1$s</string>
|
||||
|
@@ -217,7 +217,7 @@
|
||||
<string name="receive_amount_hint">金额</string>
|
||||
<string name="receive_desc_hint">描述 (选填)</string>
|
||||
<string name="receive_cannot_open">无法打开钱包!</string>
|
||||
<string name="receive_paymentid_invalid">16或64十六进制字符 (0–9,a–f)</string>
|
||||
<string name="receive_paymentid_invalid">16十六进制字符 (0–9,a–f)</string>
|
||||
<string name="receive_integrated_paymentid_invalid">集成地址的交易ID必须为空</string>
|
||||
<string name="receive_amount_too_big">上限 %1$s</string>
|
||||
<string name="receive_amount_negative">下限 0</string>
|
||||
|
@@ -267,7 +267,7 @@
|
||||
|
||||
<string name="receive_amount_hint">金額</string>
|
||||
<string name="receive_cannot_open">無法開啟錢包!</string>
|
||||
<string name="receive_paymentid_invalid">16 或 64 Hex 字元 (0–9,a–f)</string>
|
||||
<string name="receive_paymentid_invalid">16 Hex 字元 (0–9,a–f)</string>
|
||||
<string name="receive_integrated_paymentid_invalid">使用整合地址時必須為空白</string>
|
||||
|
||||
<string name="receive_amount_too_big">最大值 %1$s</string>
|
||||
|
@@ -280,7 +280,7 @@
|
||||
<string name="receive_amount_hint">Amount</string>
|
||||
<string name="receive_desc_hint">Description (optional)</string>
|
||||
<string name="receive_cannot_open">Could not open wallet!</string>
|
||||
<string name="receive_paymentid_invalid">16 or 64 Hex characters (0–9,a–f)</string>
|
||||
<string name="receive_paymentid_invalid">16 Hex characters (0–9,a–f)</string>
|
||||
<string name="receive_integrated_paymentid_invalid">Must be empty with integrated address</string>
|
||||
|
||||
<string name="receive_amount_too_big">Max. %1$s</string>
|
||||
|
Reference in New Issue
Block a user