Skip to content

Commit e66cb7e

Browse files
Merge pull request #43 from doo/ii/update_3_0_2
Update to Barcode SDK 3.0.2
2 parents 122b58a + 1b9cc1a commit e66cb7e

4 files changed

Lines changed: 58 additions & 22 deletions

File tree

Libraries.txt

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Open Source libraries used in the Scanbot Barcode Scanner SDK for Android version 3.0.1
1+
Open Source libraries used in the Scanbot Barcode Scanner SDK for Android version 3.0.2
22

33
CWAC-Camera
44

@@ -237,7 +237,7 @@ limitations under the License.
237237

238238
TensorFlow
239239

240-
Version based on GitHub commit 3ae4ccf
240+
Version based on GitHub commit a4dfb8d1a71
241241
(https://github.com/tensorflow/tensorflow)
242242

243243
Copyright 2017 The TensorFlow Authors. All Rights Reserved.
@@ -616,3 +616,42 @@ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
616616
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
617617
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
618618
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
619+
620+
621+
622+
XNNPACK
623+
624+
Version based on GitHub commit fb8d1f1b2
625+
(https://github.com/google/XNNPACK)
626+
627+
BSD License
628+
629+
For XNNPACK software
630+
631+
Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
632+
Copyright 2019 Google LLC
633+
634+
Redistribution and use in source and binary forms, with or without modification,
635+
are permitted provided that the following conditions are met:
636+
637+
* Redistributions of source code must retain the above copyright notice, this
638+
list of conditions and the following disclaimer.
639+
640+
* Redistributions in binary form must reproduce the above copyright notice,
641+
this list of conditions and the following disclaimer in the documentation
642+
and/or other materials provided with the distribution.
643+
644+
* Neither the name Facebook nor the names of its contributors may be used to
645+
endorse or promote products derived from this software without specific
646+
prior written permission.
647+
648+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
649+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
650+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
651+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
652+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
653+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
654+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
655+
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
656+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
657+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ buildscript {
55
ext.targetVersion = 29
66
ext.minVersion = 21
77
ext.kotlin_version = '1.4.20' // use the same version as SDK does
8-
ext.sdkVersion = '3.0.1'
8+
ext.sdkVersion = '3.0.2'
99
repositories {
1010
google()
1111
jcenter()

example_app/src/main/java/io/scanbot/example/sdk/barcode/ui/MainActivity.kt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import io.scanbot.example.sdk.barcode.model.BarcodeResultRepository
1616
import io.scanbot.example.sdk.barcode.model.BarcodeTypeRepository
1717
import io.scanbot.example.sdk.barcode.ui.dialog.ErrorFragment
1818
import io.scanbot.sap.Status
19+
import io.scanbot.sdk.barcode.ScanbotBarcodeDetector
1920
import io.scanbot.sdk.barcode.entity.BarcodeFormat
2021
import io.scanbot.sdk.barcode.entity.BarcodeScanningResult
2122
import io.scanbot.sdk.barcode_scanner.ScanbotBarcodeScannerSDK
@@ -34,10 +35,14 @@ class MainActivity : AppCompatActivity() {
3435
private const val IMPORT_IMAGE_REQUEST_CODE = 911
3536
}
3637

38+
private lateinit var barcodeDetector: ScanbotBarcodeDetector
39+
3740
override fun onCreate(savedInstanceState: Bundle?) {
3841
super.onCreate(savedInstanceState)
3942
setContentView(R.layout.activity_main)
4043

44+
barcodeDetector = ScanbotBarcodeScannerSDK(this).createBarcodeDetector()
45+
4146
warning_view.isVisible = ScanbotBarcodeScannerSDK(this).licenseInfo.status == Status.StatusTrial
4247

4348
findViewById<View>(R.id.qr_demo).setOnClickListener {
@@ -75,9 +80,7 @@ class MainActivity : AppCompatActivity() {
7580
imageIntent.type = "image/*"
7681
imageIntent.action = Intent.ACTION_GET_CONTENT
7782
imageIntent.putExtra(Intent.EXTRA_LOCAL_ONLY, false)
78-
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
79-
imageIntent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, false)
80-
}
83+
imageIntent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, false)
8184
startActivityForResult(
8285
Intent.createChooser(
8386
imageIntent,
@@ -133,7 +136,6 @@ class MainActivity : AppCompatActivity() {
133136
showLicenseDialog()
134137
} else {
135138
processGalleryResult(data!!)?.let { bitmap ->
136-
val barcodeDetector = sdk.barcodeDetector()
137139
barcodeDetector.modifyConfig { setBarcodeFormats(BarcodeTypeRepository.selectedTypes.toList()) }
138140
val result = barcodeDetector.detectFromBitmap(bitmap, 0)
139141

example_app/src/main/java/io/scanbot/example/sdk/barcode/ui/QRScanCameraViewActivity.kt

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,7 @@ import io.scanbot.sdk.barcode.BarcodeAutoSnappingController
2121
import io.scanbot.sdk.barcode.BarcodeDetectorFrameHandler
2222
import io.scanbot.sdk.barcode.entity.BarcodeScanningResult
2323
import io.scanbot.sdk.barcode_scanner.ScanbotBarcodeScannerSDK
24-
import io.scanbot.sdk.camera.CameraOpenCallback
25-
import io.scanbot.sdk.camera.FrameHandlerResult
26-
import io.scanbot.sdk.camera.PictureCallback
27-
import io.scanbot.sdk.camera.ScanbotCameraView
24+
import io.scanbot.sdk.camera.*
2825

2926
class QRScanCameraViewActivity : AppCompatActivity(), BarcodeDetectorFrameHandler.ResultHandler {
3027

@@ -44,16 +41,14 @@ class QRScanCameraViewActivity : AppCompatActivity(), BarcodeDetectorFrameHandle
4441
cameraView = findViewById(R.id.camera)
4542
resultView = findViewById(R.id.result)
4643

47-
cameraView!!.setCameraOpenCallback(object : CameraOpenCallback {
48-
override fun onCameraOpened() {
49-
cameraView!!.postDelayed({
50-
cameraView!!.useFlash(flashEnabled)
51-
cameraView!!.continuousFocus()
52-
}, 300)
53-
}
54-
})
44+
cameraView!!.setCameraOpenCallback {
45+
cameraView!!.postDelayed({
46+
cameraView!!.useFlash(flashEnabled)
47+
cameraView!!.continuousFocus()
48+
}, 300)
49+
}
5550

56-
val barcodeDetector = ScanbotBarcodeScannerSDK(this).barcodeDetector()
51+
val barcodeDetector = ScanbotBarcodeScannerSDK(this).createBarcodeDetector()
5752

5853
barcodeDetectorFrameHandler = BarcodeDetectorFrameHandler.attach(
5954
cameraView!!,
@@ -72,8 +67,8 @@ class QRScanCameraViewActivity : AppCompatActivity(), BarcodeDetectorFrameHandle
7267
BarcodeAutoSnappingController.attach(cameraView!!, barcodeDetectorFrameHandler!!)
7368
barcodeAutoSnappingController.setSensitivity(1f)
7469
cameraView?.addPictureCallback(object : PictureCallback() {
75-
override fun onPictureTaken(image: ByteArray, imageOrientation: Int) {
76-
this@QRScanCameraViewActivity.processPictureTaken(image, imageOrientation)
70+
override fun onPictureTaken(image: ByteArray, captureInfo: CaptureInfo) {
71+
processPictureTaken(image, captureInfo.imageOrientation)
7772
}
7873
})
7974
}

0 commit comments

Comments
 (0)