Skip to content
Open
Show file tree
Hide file tree
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
19 changes: 0 additions & 19 deletions sample/src/main/java/example/zxing/CustomScannerActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@

import com.journeyapps.barcodescanner.CaptureManager;
import com.journeyapps.barcodescanner.DecoratedBarcodeView;
import com.journeyapps.barcodescanner.ViewfinderView;

import java.util.Random;

/**
* Custom Scannner Activity extending from Activity to display a custom layout form scanner view.
Expand All @@ -25,7 +22,6 @@ public class CustomScannerActivity extends Activity implements
private CaptureManager capture;
private DecoratedBarcodeView barcodeScannerView;
private Button switchFlashlightButton;
private ViewfinderView viewfinderView;

@Override
protected void onCreate(Bundle savedInstanceState) {
Expand All @@ -37,8 +33,6 @@ protected void onCreate(Bundle savedInstanceState) {

switchFlashlightButton = findViewById(R.id.switch_flashlight);

viewfinderView = findViewById(R.id.zxing_viewfinder_view);

// if the device does not have flashlight in its camera,
// then remove the switch flashlight button...
if (!hasFlash()) {
Expand All @@ -49,9 +43,6 @@ protected void onCreate(Bundle savedInstanceState) {
capture.initializeFromIntent(getIntent(), savedInstanceState);
capture.setShowMissingCameraPermissionDialog(false);
capture.decode();

changeMaskColor(null);
changeLaserVisibility(true);
}

@Override
Expand Down Expand Up @@ -100,16 +91,6 @@ public void switchFlashlight(View view) {
}
}

public void changeMaskColor(View view) {
Random rnd = new Random();
int color = Color.argb(100, rnd.nextInt(256), rnd.nextInt(256), rnd.nextInt(256));
viewfinderView.setMaskColor(color);
}

public void changeLaserVisibility(boolean visible) {
viewfinderView.setLaserVisibility(visible);
}

@Override
public void onTorchOn() {
switchFlashlightButton.setText(R.string.turn_off_flashlight);
Expand Down
14 changes: 7 additions & 7 deletions sample/src/main/res/layout/custom_barcode_scanner.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<merge xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto">
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto">

<com.journeyapps.barcodescanner.BarcodeView
android:layout_width="match_parent"
Expand All @@ -11,14 +11,14 @@
app:zxing_framing_rect_height="50dp"/>

<com.journeyapps.barcodescanner.ViewfinderView
android:id="@+id/zxing_viewfinder_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/zxing_viewfinder_view"
app:zxing_possible_result_points="@color/zxing_custom_possible_result_points"
app:borderWidth="4dp"
app:cornerRadius="6dp"
app:zxing_possible_result_points="@android:color/white"
app:zxing_result_view="@color/zxing_custom_result_view"
app:zxing_viewfinder_laser="@color/zxing_custom_viewfinder_laser"
app:zxing_viewfinder_laser_visibility="true"
app:zxing_viewfinder_mask="@color/zxing_custom_viewfinder_mask"/>
app:zxing_viewfinder_mask="@color/zxing_custom_viewfinder_mask" />

<TextView
android:id="@+id/zxing_status_view"
Expand Down
1 change: 1 addition & 0 deletions zxing-android-embedded/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ dependencies {
api project.zxingCore

api 'androidx.legacy:legacy-support-v4:1.0.0'
api "com.google.android.material:material:1.3.0-alpha03"

testImplementation 'junit:junit:4.13'
testImplementation "org.mockito:mockito-core:1.9.5"
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#Sat Jul 11 23:00:06 IST 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
172 changes: 172 additions & 0 deletions zxing-android-embedded/gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

84 changes: 84 additions & 0 deletions zxing-android-embedded/gradlew.bat

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading