A library to help implement barcode scanning
Tap to Focus, Camera Flash Mode, Firebase ML to Play Services MLKit
Migrating to version 1.3.0
of KBarcode does involve a couple of small changes to your code.
We have renamed all uses of ScaleType to PreviewScaleType. This clarifies more precisely what this attribute does. It also means KBarcode shouldn't clash with camerax lib should you have both installed. The behaviour of this attribute hasn't changed.
Depending on exactly how you've implemented KBarcode, you should simply be able to replace your use like for like. For example:
XML: app:scaleType="centerInside"
-> app:previewScaleType="centerInside"
Kotlin: .scaleType(BarcodeView.CENTER_INSIDE)
-> .previewScaleType(BarcodeView.CENTER_INSIDE)
The deprecated setBarcodeFormats
method which was deprecated in 1.0.3 has now been removed. Please make use of the IntArray
replacement for this method.
KBarcode/releases/tag/v1.0.3
3.6.1
-> 4.2.1
5.6.4
-> 6.7.1
1.3.71
-> 1.4.32
4.3.3
-> 4.3.8
1.3.4
-> 1.4.3
1.1.0
-> 1.3.0
1.1.3
-> 2.0.4
28.1.0
2.2.0
-> 2.3.1
29
-> 30
firebase-ml-vision
to play-services-mlkit-barcode-scanning
#39Changes:
Update from 1.2.0 -> 1.2.1 will be required.
There was an issue with the 1.2.0 artifact meaning a class wasn't included. Fixed this issue.
We have fixed the sorting of barcodes not being used. We are now targeting Java8 in order to be able to use the latest tooling.
Changes
Changes
createCaptureSession()
openCamera()
createCaptureRequest()
and setRepeatingRequest()
onImageAvailable
callbackWe highly recommend updating from 1.0.4 to 1.0.5, since this update fixes a a couple of significant issues.
#23 Made some fixes to the way we use coroutines. Cancelled the current job rather than scope so that we can launch new coroutines from the same scope. Changed our Firebase call to be a suspend call.
#22 Added a check after opening the camera to ensure that the surfaces are still valid.
There were some dropped frames in some cases. This was caused by FirebaseVisionImage.fromMediaImage(image, frameMetadata.rotation)
taking too long. To solve we introduced coroutines to the project and made this run on a background thread.
We have changed the API to now use IntArray instead of Array<Int> for barcode formats. We did this because IntArray is more efficient. We have deprecated the previous method, and it will be removed in a future release. We have offered a quick fix replacement if you are using Android Studio. You may wish to consider making changes in your code to utilise IntArray and gain the efficiencies too.
Just put your cursor on the method and use your shortcut for quick fix
https://developer.android.com/studio/intro/keyboard-shortcuts Project quick fix (show intention actions and quick fixes) | Alt + Enter | Option + Enter
#13 - See this issue for some more details
In summary calling start()
twice in quick succession caused issues because our Camera2Source
was only tracking isStarted()
and not "is starting". We have now added this in the form of isOpening()
, meaning it should now be safe to call start()
twice.
We updated our quality config files to our latest standards here at Brightec. This caused a few minor changes in order to fix out some newly identified inefficiencies.