mirror of
https://github.com/CatimaLoyalty/Android.git
synced 2026-04-01 22:31:51 -04:00
Don't show update barcode dialog if value is the same as card ID
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
Changes:
|
||||
|
||||
- Add missing barcode ID to export
|
||||
- Don't show update barcode dialog if value is the same as card ID
|
||||
|
||||
## v1.14 (2021-06-07)
|
||||
|
||||
|
||||
@@ -707,6 +707,18 @@ public class LoyaltyCardEditActivity extends AppCompatActivity
|
||||
}
|
||||
|
||||
private void askBarcodeChange(Runnable callback) {
|
||||
if (tempStoredOldBarcodeValue.equals(cardIdFieldView.getText().toString())) {
|
||||
// They are the same, don't ask
|
||||
barcodeIdField.setText(R.string.sameAsCardId);
|
||||
tempStoredOldBarcodeValue = null;
|
||||
|
||||
if (callback != null) {
|
||||
callback.run();
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
new AlertDialog.Builder(this)
|
||||
.setTitle(R.string.updateBarcodeQuestionTitle)
|
||||
.setMessage(R.string.updateBarcodeQuestionText)
|
||||
@@ -726,6 +738,14 @@ public class LoyaltyCardEditActivity extends AppCompatActivity
|
||||
callback.run();
|
||||
}
|
||||
})
|
||||
.setOnDismissListener(dialogInterface -> {
|
||||
barcodeIdField.setText(tempStoredOldBarcodeValue);
|
||||
tempStoredOldBarcodeValue = null;
|
||||
|
||||
if (callback != null) {
|
||||
callback.run();
|
||||
}
|
||||
})
|
||||
.show();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user