Skip to content

Commit

Permalink
add more output currencies (#714)
Browse files Browse the repository at this point in the history
  • Loading branch information
m2049r authored Feb 15, 2021
1 parent 57ddddf commit faf57c9
Show file tree
Hide file tree
Showing 83 changed files with 1,866 additions and 1,104 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
applicationId "com.m2049r.xmrwallet"
minSdkVersion 21
targetSdkVersion 29
versionCode 702
versionName "1.17.2 'Druk'"
versionCode 705
versionName "1.17.5.1 'Druk'"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
externalNativeBuild {
cmake {
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/m2049r/xmrwallet/BaseActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ private void processNfcIntent(Intent intent) {
if (uri == null) {
Toast.makeText(this, getString(R.string.nfc_tag_read_undef), Toast.LENGTH_LONG).show();
} else {
BarcodeData bc = BarcodeData.fromQrCode(uri.toString());
BarcodeData bc = BarcodeData.fromString(uri.toString());
if (bc == null)
Toast.makeText(this, getString(R.string.nfc_tag_read_undef), Toast.LENGTH_LONG).show();
else
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/java/com/m2049r/xmrwallet/ReceiveFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
import com.google.zxing.qrcode.decoder.ErrorCorrectionLevel;
import com.m2049r.xmrwallet.BuildConfig;
import com.m2049r.xmrwallet.data.BarcodeData;
import com.m2049r.xmrwallet.data.Crypto;
import com.m2049r.xmrwallet.ledger.LedgerProgressDialog;
import com.m2049r.xmrwallet.model.Wallet;
import com.m2049r.xmrwallet.model.WalletManager;
Expand Down Expand Up @@ -469,7 +470,7 @@ private void generateQr() {
Timber.d("CLEARQR");
return;
}
bcData = new BarcodeData(BarcodeData.Asset.XMR, address, notes, xmrAmount);
bcData = new BarcodeData(Crypto.XMR, address, notes, xmrAmount);
int size = Math.max(ivQrCode.getWidth(), ivQrCode.getHeight());
Bitmap qr = generate(bcData.getUriString(), size, size);
if (qr != null) {
Expand Down
9 changes: 1 addition & 8 deletions app/src/main/java/com/m2049r/xmrwallet/ScannerFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,7 @@ public void handleResult(Result rawResult) {
// * On older devices continuously stopping and resuming camera preview can result in freezing the app.
// * I don't know why this is the case but I don't have the time to figure out.
Handler handler = new Handler();
handler.postDelayed(new

Runnable() {
@Override
public void run() {
mScannerView.resumeCameraPreview(ScannerFragment.this);
}
}, 2000);
handler.postDelayed(() -> mScannerView.resumeCameraPreview(ScannerFragment.this), 2000);
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/m2049r/xmrwallet/TxFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ void showBtcInfo() {
}
tvTxXmrToKey.setText(key);
tvDestinationBtc.setText(userNotes.xmrtoDestination);
tvTxAmountBtc.setText(userNotes.xmrtoAmount + " BTC");
tvTxAmountBtc.setText(userNotes.xmrtoAmount + " "+ userNotes.xmrtoCurrency);
switch (userNotes.xmrtoTag) {
case "xmrto":
tvXmrToSupport.setVisibility(View.GONE);
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/m2049r/xmrwallet/WalletActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -921,7 +921,7 @@ public void onScan() {
@Override
public boolean onScanned(String qrCode) {
// #gurke
BarcodeData bcData = BarcodeData.fromQrCode(qrCode);
BarcodeData bcData = BarcodeData.fromString(qrCode);
if (bcData != null) {
popFragmentStack(null);
Timber.d("AAA");
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/java/com/m2049r/xmrwallet/WalletFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
import com.m2049r.xmrwallet.service.exchange.api.ExchangeCallback;
import com.m2049r.xmrwallet.service.exchange.api.ExchangeRate;
import com.m2049r.xmrwallet.util.Helper;
import com.m2049r.xmrwallet.util.ServiceHelper;
import com.m2049r.xmrwallet.widget.Toolbar;

import java.text.NumberFormat;
Expand Down Expand Up @@ -242,7 +243,7 @@ void updateBalance() {
String balanceCurrency = Helper.BASE_CRYPTO;
double balanceRate = 1.0;

private final ExchangeApi exchangeApi = Helper.getExchangeApi();
private final ExchangeApi exchangeApi = ServiceHelper.getExchangeApi();

void refreshBalance() {
double unconfirmedXmr = Helper.getDecimalAmount(balance - unlockedBalance).doubleValue();
Expand Down
Loading

0 comments on commit faf57c9

Please sign in to comment.