mirror of
https://github.com/CatimaLoyalty/Android.git
synced 2026-09-12 22:33:37 -04:00
Fix extreme padding on some barcode types
This commit is contained in:
1 parent
78d0bc7bb7
commit
1ce4216584
2 files changed
+11
-1
No files matched your search
@@ -61,7 +61,12 @@ public class BarcodeImageWriterTask implements CompatCallable<Bitmap> {
|
||||
cardId = cardIdString;
|
||||
format = barcodeFormat;
|
||||
|
||||
int padding = roundCornerPadding ? Math.round(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 10, context.getResources().getDisplayMetrics())) : 0;
|
||||
int padding = 0;
|
||||
// Some barcodes already have internal whitespace and shouldn't get extra padding
|
||||
// TODO: Get rid of this hack by somehow detecting this extra whitespace
|
||||
if (roundCornerPadding && !barcodeFormat.hasInternalPadding()) {
|
||||
padding = Math.round(TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 10, context.getResources().getDisplayMetrics()));
|
||||
}
|
||||
|
||||
final int MAX_WIDTH = getMaxWidth(format);
|
||||
|
||||
|
||||
Reference in new issue
Block a user