Skip to content

Commit 1ed2b01

Browse files
committed
One more correction by Sylvia: 'For safety, let's do the DB update last. If we somehow set a value that causes a crash it won't be saved to the DB'
1 parent 8a7ef8f commit 1ed2b01

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

app/src/main/java/protect/card_locker/LoyaltyCardViewActivity.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,6 @@ public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
369369
float scale = (float) progress / (float) binding.barcodeWidthscaler.getMax();
370370
Log.d(TAG, "Scaling to " + scale);
371371
}
372-
DBHelper.updateLoyaltyCardZoomLevel(database, loyaltyCardId, loyaltyCard.zoomLevel, loyaltyCard.zoomLevelWidth);
373372
if (seekBar.getId() == binding.barcodeScaler.getId()) {
374373
loyaltyCard.zoomLevel = progress;
375374
setScalerGuideline(loyaltyCard.zoomLevel);
@@ -378,6 +377,8 @@ public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
378377
loyaltyCard.zoomLevelWidth = progress;
379378
setScalerWidthGuideline(loyaltyCard.zoomLevelWidth);
380379
}
380+
381+
DBHelper.updateLoyaltyCardZoomLevel(database, loyaltyCardId, loyaltyCard.zoomLevel, loyaltyCard.zoomLevelWidth);
381382
drawMainImage(mainImageIndex, true, isFullscreen);
382383
}
383384
@Override

0 commit comments

Comments
 (0)