Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix Cannot resolve symbol 'ActivityCompat' & feat: support scanning other formats of barcode #365

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion src/android/QRScanner.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import org.json.JSONObject;
import android.hardware.Camera;
import android.provider.Settings;
import android.support.v4.app.ActivityCompat;
import androidx.core.app.ActivityCompat;
import android.view.ViewGroup;
import android.widget.FrameLayout;

Expand Down Expand Up @@ -455,7 +455,22 @@ public void run() {

//Configure the decoder
ArrayList<BarcodeFormat> formatList = new ArrayList<BarcodeFormat>();
formatList.add(BarcodeFormat.AZTEC);
formatList.add(BarcodeFormat.CODABAR);
formatList.add(BarcodeFormat.CODE_128);
formatList.add(BarcodeFormat.CODE_39);
formatList.add(BarcodeFormat.CODE_93);
formatList.add(BarcodeFormat.DATA_MATRIX);
formatList.add(BarcodeFormat.EAN_13);
formatList.add(BarcodeFormat.EAN_8);
formatList.add(BarcodeFormat.ITF);
formatList.add(BarcodeFormat.PDF_417);
formatList.add(BarcodeFormat.QR_CODE);
formatList.add(BarcodeFormat.RSS_14);
formatList.add(BarcodeFormat.RSS_EXPANDED);
formatList.add(BarcodeFormat.UPC_A);
formatList.add(BarcodeFormat.UPC_E);
formatList.add(BarcodeFormat.UPC_EAN_EXTENSION);
mBarcodeView.setDecoderFactory(new DefaultDecoderFactory(formatList, null, null));

//Configure the camera (front/back)
Expand Down