diff --git a/app/src/main/java/protect/card_locker/CatimaBarcode.java b/app/src/main/java/protect/card_locker/CatimaBarcode.java index 59a1d5305..2b295f5c5 100644 --- a/app/src/main/java/protect/card_locker/CatimaBarcode.java +++ b/app/src/main/java/protect/card_locker/CatimaBarcode.java @@ -63,6 +63,13 @@ public class CatimaBarcode { return barcodeFormats.contains(mBarcodeFormat); } + public boolean isSquare(){ + return mBarcodeFormat == BarcodeFormat.AZTEC + || mBarcodeFormat == BarcodeFormat.DATA_MATRIX + || mBarcodeFormat == BarcodeFormat.MAXICODE + || mBarcodeFormat == BarcodeFormat.QR_CODE; + } + public BarcodeFormat format() { return mBarcodeFormat; } diff --git a/app/src/main/java/protect/card_locker/LoyaltyCardViewActivity.java b/app/src/main/java/protect/card_locker/LoyaltyCardViewActivity.java index 11bb5bd25..91bbb2b2b 100644 --- a/app/src/main/java/protect/card_locker/LoyaltyCardViewActivity.java +++ b/app/src/main/java/protect/card_locker/LoyaltyCardViewActivity.java @@ -268,7 +268,10 @@ public class LoyaltyCardViewActivity extends CatimaAppCompatActivity implements if (imageTypes.get(mainImageIndex) == ImageType.BARCODE) { redrawBarcodeAfterResize(); } - centerGuideline.setGuidelinePercent(0.5f * scale); + if(loyaltyCard!=null && format!=null && format.isSquare()) + centerGuideline.setGuidelinePercent(0.75f * scale); + else + centerGuideline.setGuidelinePercent(0.5f * scale); } @Override @@ -417,6 +420,12 @@ public class LoyaltyCardViewActivity extends CatimaAppCompatActivity implements setupOrientation(); format = loyaltyCard.barcodeType; + if(format != null && format.isSquare()){ + centerGuideline.setGuidelinePercent(0.75f); + } + else{ + centerGuideline.setGuidelinePercent(0.5f); + } cardIdString = loyaltyCard.cardId; barcodeIdString = loyaltyCard.barcodeId;