From 68a183e573824b841252ed0b170cccf6ecf60cac Mon Sep 17 00:00:00 2001 From: Julian Finkler Date: Sat, 25 Apr 2020 10:43:45 +0200 Subject: [PATCH 1/5] Update issue templates --- .github/ISSUE_TEMPLATE/bug_report.md | 41 +++++++++++++++++++++++ .github/ISSUE_TEMPLATE/feature_request.md | 20 +++++++++++ 2 files changed, 61 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 00000000..096f8c4f --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,41 @@ +--- +name: Bug report +about: Create a report to help us improve +title: "[Bug]" +labels: bug +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Logs** +If applicable, add the verbose output of `flutter run`. + +**Environment (please complete the following information):** + - [ ] iOS? Version: ... + - [ ] Android? Version: ... + - [ ] Real Device? Which?: ... + - [ ] Emulator/Simulator? Which?: ... + - Version of `barcode_scan` + - Output of `flutter --version`: +``` +Flutter ... +``` + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 00000000..956fa874 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: "[Feature Request]" +labels: Feature +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. From a2934258f9b6059803da748eae4ad9d24881363f Mon Sep 17 00:00:00 2001 From: Julian Finkler Date: Sat, 25 Apr 2020 22:20:58 +0200 Subject: [PATCH 2/5] Update UPGRADE.md --- UPGRADE.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/UPGRADE.md b/UPGRADE.md index 187855d8..6b37fb37 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -4,6 +4,8 @@ The `BarcodeScan.scan()` method returns a [`ScanResult`](./lib/model/scan_result The barcode is stored in `ScanResult.rawContent` Check your calls to this method and read the barcode from the `rawContent` property. +If your project uses pre Flutter 1.12 you need to update Flutter in your App: https://github.com/flutter/flutter/wiki/Upgrading-pre-1.12-Android-projects + # Upgrade from 1.0.0 to 2.0.0 From 9698db0f0b1299a2697779ec463f8d8aaa7bae84 Mon Sep 17 00:00:00 2001 From: Vincenzo Date: Tue, 5 May 2020 22:30:43 +0200 Subject: [PATCH 3/5] add fix for autofocus with logging --- .../de/mintware/barcode_scan/ZXingAutofocusScannerView.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/android/src/main/kotlin/de/mintware/barcode_scan/ZXingAutofocusScannerView.kt b/android/src/main/kotlin/de/mintware/barcode_scan/ZXingAutofocusScannerView.kt index b12c0c9b..88c375af 100644 --- a/android/src/main/kotlin/de/mintware/barcode_scan/ZXingAutofocusScannerView.kt +++ b/android/src/main/kotlin/de/mintware/barcode_scan/ZXingAutofocusScannerView.kt @@ -9,10 +9,12 @@ import me.dm7.barcodescanner.zxing.ZXingScannerView class ZXingAutofocusScannerView(context: Context) : ZXingScannerView(context) { private var callbackFocus = false + private var autofocusPresence = false override fun setupCameraPreview(cameraWrapper: CameraWrapper?) { cameraWrapper?.mCamera?.parameters?.let { parameters -> try { + autofocusPresence = parameters.supportedFocusModes.contains(Camera.Parameters.FOCUS_MODE_AUTO); parameters.focusMode = Camera.Parameters.FOCUS_MODE_CONTINUOUS_PICTURE cameraWrapper.mCamera.parameters = parameters } catch (ex: Exception) { @@ -23,6 +25,9 @@ class ZXingAutofocusScannerView(context: Context) : ZXingScannerView(context) { } override fun setAutoFocus(state: Boolean) { - super.setAutoFocus(callbackFocus) + Log.e("oznecniV97", "autofocusPresence $autofocusPresence") + if(autofocusPresence){ + super.setAutoFocus(callbackFocus) + } } } \ No newline at end of file From bde741cc891f396f6a4b018e3e2040105abf853c Mon Sep 17 00:00:00 2001 From: Vincenzo Date: Tue, 5 May 2020 23:23:27 +0200 Subject: [PATCH 4/5] add comment and remove log for merge on master project --- .../de/mintware/barcode_scan/ZXingAutofocusScannerView.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/src/main/kotlin/de/mintware/barcode_scan/ZXingAutofocusScannerView.kt b/android/src/main/kotlin/de/mintware/barcode_scan/ZXingAutofocusScannerView.kt index 88c375af..8b68fe55 100644 --- a/android/src/main/kotlin/de/mintware/barcode_scan/ZXingAutofocusScannerView.kt +++ b/android/src/main/kotlin/de/mintware/barcode_scan/ZXingAutofocusScannerView.kt @@ -25,7 +25,7 @@ class ZXingAutofocusScannerView(context: Context) : ZXingScannerView(context) { } override fun setAutoFocus(state: Boolean) { - Log.e("oznecniV97", "autofocusPresence $autofocusPresence") + //Fix to avoid crash on devices without autofocus (Issue #226) if(autofocusPresence){ super.setAutoFocus(callbackFocus) } From bcb31de2a1a88612283e3a4398fc00667b81de39 Mon Sep 17 00:00:00 2001 From: Julian Finkler Date: Fri, 8 May 2020 18:49:17 +0200 Subject: [PATCH 5/5] CHANGELOG updated --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c80c4de..c7613e48 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,9 @@ Features: - [Added cancel for ux](https://github.com/mintware-de/flutter_barcode_reader/pull/198) - @iRaySpace +Bugfixes: +- [Fix autofocus crash](https://github.com/mintware-de/flutter_barcode_reader/pull/228) - @oznecniV97 + ## v3.0.0 - 2020-04-18 Bugfixes: