mirror of
https://github.com/CatimaLoyalty/Android.git
synced 2026-03-31 13:51:52 -04:00
Add note on unsupported barcode type
This commit is contained in:
@@ -388,7 +388,13 @@ public class LoyaltyCardEditActivity extends AppCompatActivity
|
||||
barcodeTypeField.setTag(null);
|
||||
} else {
|
||||
try {
|
||||
barcodeTypeField.setTag(BarcodeFormat.valueOf(s.toString()));
|
||||
BarcodeFormat barcodeFormat = BarcodeFormat.valueOf(s.toString());
|
||||
|
||||
barcodeTypeField.setTag(barcodeFormat);
|
||||
|
||||
if (!BarcodeSelectorActivity.SUPPORTED_BARCODE_TYPES.contains(barcodeFormat.name())) {
|
||||
Toast.makeText(LoyaltyCardEditActivity.this, getString(R.string.unsupportedBarcodeType), Toast.LENGTH_LONG).show();
|
||||
}
|
||||
} catch (IllegalArgumentException e) {}
|
||||
}
|
||||
|
||||
|
||||
@@ -387,7 +387,15 @@ public class LoyaltyCardViewActivity extends AppCompatActivity
|
||||
// Set shadow colour of store text so even same color on same color would be readable
|
||||
storeName.setShadowLayer(1, 1, 1, backgroundNeedsDarkIcons ? Color.BLACK : Color.WHITE);
|
||||
|
||||
if(format != null)
|
||||
Boolean isBarcodeSupported = true;
|
||||
|
||||
if (format != null && !BarcodeSelectorActivity.SUPPORTED_BARCODE_TYPES.contains(format.name())) {
|
||||
isBarcodeSupported = false;
|
||||
|
||||
Toast.makeText(this, getString(R.string.unsupportedBarcodeType), Toast.LENGTH_LONG).show();
|
||||
}
|
||||
|
||||
if(format != null && isBarcodeSupported)
|
||||
{
|
||||
if (!barcodeIsFullscreen) {
|
||||
maximizeButton.setVisibility(View.VISIBLE);
|
||||
|
||||
@@ -171,4 +171,5 @@
|
||||
<string name="barcodeId">Barcode value</string>
|
||||
<string name="sameAsCardId">Same as card ID</string>
|
||||
<string name="setBarcodeId">Set barcode value</string>
|
||||
<string name="unsupportedBarcodeType">We cannot currently display this barcode type. We hope to add support in a newer version of the app.</string>
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user