diff options
| author | Andre Ippisch <andre.ippisch@uni-duesseldorf.de> | 2019-10-17 15:21:23 +0300 |
|---|---|---|
| committer | Ralf Kistner <ralf@journeyapps.com> | 2019-10-17 15:21:23 +0300 |
| commit | aa4fca5dae65d8d7789f7519d3ff1287f355d0b6 (patch) | |
| tree | 3caba62bb4dc8f64aa66c95ce1ae78179fd4fcfc /sample/src/main/java/example | |
| parent | d22b581cd303a6e785c4a40263803e867b7f54db (diff) | |
| download | zxing-android-embedded-aa4fca5dae65d8d7789f7519d3ff1287f355d0b6.tar.xz | |
Let visibility of "laser scanner" be set (#503)
* Add laser visibility attribute
* Add laser visibility attribute usage to sample project
- set to true to stick with the current behavior
- included for didactic reasons
* Add laser visibility attribute to ViewfinderView and set it accordingly
* Draw "laser scanner" only if wanted
* Let laser visibility be changed programmatically
* Add sample code to show how laser visibility can be changed programmatically
Diffstat (limited to 'sample/src/main/java/example')
| -rw-r--r-- | sample/src/main/java/example/zxing/CustomScannerActivity.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sample/src/main/java/example/zxing/CustomScannerActivity.java b/sample/src/main/java/example/zxing/CustomScannerActivity.java index 2292e59f..12840733 100644 --- a/sample/src/main/java/example/zxing/CustomScannerActivity.java +++ b/sample/src/main/java/example/zxing/CustomScannerActivity.java @@ -48,6 +48,7 @@ public class CustomScannerActivity extends Activity implements capture.decode(); changeMaskColor(null); + changeLaserVisibility(true); } @Override @@ -102,6 +103,10 @@ public class CustomScannerActivity extends Activity implements viewfinderView.setMaskColor(color); } + public void changeLaserVisibility(boolean visible) { + viewfinderView.setLaserVisibility(visible); + } + @Override public void onTorchOn() { switchFlashlightButton.setText(R.string.turn_off_flashlight); |
