Don't force-reset loyalty card type

This commit is contained in:
Sylvia van Os
2021-04-06 22:45:32 +02:00
parent 27a90615a9
commit ac810a0c6f
2 changed files with 3 additions and 8 deletions

View File

@@ -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)

View File

@@ -99,8 +99,7 @@ public class LoyaltyCardEditActivity extends AppCompatActivity
AlertDialog confirmExitDialog = null;
boolean validBalance = true;
BarcodeFormat lastValidBarcodeType = null;
Runnable updateOrRevertValidBarcodeType;
Runnable warnOnInvalidBarcodeType;
HashMap<String, Currency> 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));
}
}
};