From ac810a0c6fa9141da52fb7f829f35797e141b267 Mon Sep 17 00:00:00 2001 From: Sylvia van Os Date: Tue, 6 Apr 2021 22:45:32 +0200 Subject: [PATCH] Don't force-reset loyalty card type --- CHANGELOG.md | 1 - .../protect/card_locker/LoyaltyCardEditActivity.java | 10 +++------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a9709ee7e..7be9af75c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,6 @@ Changes: - Several small UI fixes - Use letter icon for shortcuts too - Always show all barcode types in manual entry -- Revert to valid barcode type if the value is not valid for the selected barcode type in edit activity - Remove privacy policy first start dialog ## v1.12 (2021-03-30) diff --git a/app/src/main/java/protect/card_locker/LoyaltyCardEditActivity.java b/app/src/main/java/protect/card_locker/LoyaltyCardEditActivity.java index 0502945e4..040411a9d 100644 --- a/app/src/main/java/protect/card_locker/LoyaltyCardEditActivity.java +++ b/app/src/main/java/protect/card_locker/LoyaltyCardEditActivity.java @@ -99,8 +99,7 @@ public class LoyaltyCardEditActivity extends AppCompatActivity AlertDialog confirmExitDialog = null; boolean validBalance = true; - BarcodeFormat lastValidBarcodeType = null; - Runnable updateOrRevertValidBarcodeType; + Runnable warnOnInvalidBarcodeType; HashMap currencies = new HashMap<>(); @@ -160,14 +159,11 @@ public class LoyaltyCardEditActivity extends AppCompatActivity enterButton = findViewById(R.id.enterButton); - updateOrRevertValidBarcodeType = new Runnable() { + warnOnInvalidBarcodeType = new Runnable() { @Override public void run() { - if ((boolean) barcodeImage.getTag()) { - lastValidBarcodeType = (BarcodeFormat) barcodeTypeField.getTag(); - } else { + if (!(boolean) barcodeImage.getTag()) { Toast.makeText(LoyaltyCardEditActivity.this, getString(R.string.wrongValueForBarcodeType), Toast.LENGTH_LONG).show(); - barcodeTypeField.setText(lastValidBarcodeType != null ? lastValidBarcodeType.name() : getString(R.string.noBarcode)); } } };