From dfa237958ea7024d14bcdc16011a691f60d51aa2 Mon Sep 17 00:00:00 2001 From: Sylvia van Os Date: Fri, 22 Oct 2021 22:17:13 +0200 Subject: [PATCH] Fix several small sizing bugs --- .../card_locker/LoyaltyCardViewActivity.java | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/app/src/main/java/protect/card_locker/LoyaltyCardViewActivity.java b/app/src/main/java/protect/card_locker/LoyaltyCardViewActivity.java index ed6f4ca86..702c0776a 100644 --- a/app/src/main/java/protect/card_locker/LoyaltyCardViewActivity.java +++ b/app/src/main/java/protect/card_locker/LoyaltyCardViewActivity.java @@ -247,9 +247,7 @@ public class LoyaltyCardViewActivity extends CatimaAppCompatActivity implements appBarLayout = findViewById(R.id.app_bar_layout); centerGuideline = findViewById(R.id.centerGuideline); - centerGuideline.setGuidelinePercent(0.5f); barcodeScaler = findViewById(R.id.barcodeScaler); - barcodeScaler.setProgress(100); maximizeButton.setBackgroundColor(getThemeColor()); minimizeButton.setBackgroundColor(getThemeColor()); bottomSheetButton.setBackgroundColor(getThemeColor()); @@ -260,18 +258,21 @@ public class LoyaltyCardViewActivity extends CatimaAppCompatActivity implements Log.d(TAG, "Max is " + barcodeScaler.getMax()); float scale = (float) progress / (float) barcodeScaler.getMax(); Log.d(TAG, "Scaling to " + scale); + if(isFullscreen){ loyaltyCard.zoomLevel = progress; + db.updateLoyaltyCardZoomLevel(loyaltyCardId, loyaltyCard.zoomLevel); } - if (imageTypes.get(mainImageIndex) == ImageType.BARCODE) { - redrawBarcodeAfterResize(); - } if (format != null && format.isSquare()) { centerGuideline.setGuidelinePercent(0.75f * scale); } else { centerGuideline.setGuidelinePercent(0.5f * scale); } + + if (imageTypes.get(mainImageIndex) == ImageType.BARCODE) { + redrawBarcodeAfterResize(); + } } @Override @@ -416,11 +417,6 @@ 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; @@ -836,7 +832,6 @@ public class LoyaltyCardViewActivity extends CatimaAppCompatActivity implements } else { Log.d(TAG, "Move out of fullscreen"); - db.updateLoyaltyCardZoomLevel(loyaltyCardId,loyaltyCard.zoomLevel); // Reset center guideline barcodeScaler.setProgress(100);