Skip to content

Commit

Permalink
Add inverted QR code scanning
Browse files Browse the repository at this point in the history
  • Loading branch information
henkelmax committed Dec 13, 2021
1 parent 1358fc8 commit 58e4e2b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ android {
applicationId "de.maxhenkel.qrscanner"
minSdkVersion 24
targetSdkVersion 31
versionCode 8
versionName "0.0.8"
versionCode 9
versionName "0.0.9"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/java/de/maxhenkel/qrscanner/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@

import androidx.annotation.NonNull;

import com.google.zxing.client.android.Intents;
import com.journeyapps.barcodescanner.CaptureManager;
import com.journeyapps.barcodescanner.DecoratedBarcodeView;
import com.journeyapps.barcodescanner.DefaultDecoderFactory;
import com.journeyapps.barcodescanner.camera.CameraSettings;

import de.maxhenkel.qrscanner.parser.ScanResult;
Expand Down Expand Up @@ -58,6 +60,8 @@ protected void onCreate(Bundle savedInstanceState) {
settings.setFocusMode(CameraSettings.FocusMode.CONTINUOUS);
scannerView.setCameraSettings(settings);

scannerView.setDecoderFactory(new DefaultDecoderFactory(null, null, null, Intents.Scan.MIXED_SCAN));

if (!getApplicationContext().getPackageManager().hasSystemFeature(PackageManager.FEATURE_CAMERA_FLASH)) {
flashLayout.setVisibility(View.GONE);
}
Expand Down

0 comments on commit 58e4e2b

Please sign in to comment.