mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-28 20:06:29 +01:00
Barcode improvements
This commit is contained in:
@@ -223,9 +223,11 @@ public class AdapterMedia extends RecyclerView.Adapter<AdapterMedia.ViewHolder>
|
||||
Log.w(ex);
|
||||
}
|
||||
|
||||
if (barcode_preview)
|
||||
// https://github.com/zxing/zxing/wiki/Frequently-Asked-Questions#developers
|
||||
if (barcode_preview &&
|
||||
Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
|
||||
try (InputStream is = new FileInputStream(file)) {
|
||||
Bitmap bitmap = BitmapFactory.decodeStream(is);
|
||||
Bitmap bitmap = ImageHelper.getScaledBitmap(is, file.getAbsolutePath(), type, max);
|
||||
int width = bitmap.getWidth(), height = bitmap.getHeight();
|
||||
int[] pixels = new int[width * height];
|
||||
bitmap.getPixels(pixels, 0, width, 0, 0, width, height);
|
||||
|
||||
@@ -1351,6 +1351,7 @@ public class FragmentOptionsDisplay extends FragmentBase implements SharedPrefer
|
||||
}
|
||||
});
|
||||
|
||||
swBarcodePreview.setVisibility(Build.VERSION.SDK_INT >= Build.VERSION_CODES.N ? View.VISIBLE : View.GONE);
|
||||
swBarcodePreview.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton compoundButton, boolean checked) {
|
||||
|
||||
Reference in New Issue
Block a user