Skip to content

CListery/CameraX-QRcode

Repository files navigation

CameraX-QRcode

ZXing QR code package library implemented by CameraX

Feature

  • Simple to use
  • Auto focus camera, improve decoding speed
  • When scanning and decoding is successful, it will automatically stop scanning
  • No need to consider camera destruction related actions

Download

implementation 'io.github.clistery:camerax-scanner-qrcode:1.1.2'

USE

  • in xml

    <com.yh.cxqr.QRScannerView
        android:id="@+id/scanner"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />
  • start scan

    beginScan()
  • end scan

    stopScan()
  • register scan result callback

    resultCallback = object : QRScannerView.IScanResultCallback {
        override fun onCallback(result: Barcode) {
        }
    }
  • on/off flash

    switchFlash()
  • decode ImageProxy

    QRCodeParser().decodeImageProxy(imageProxy, success, fail)
  • decode image uri

    QRCodeParser().decodeImageUri(context, fileUri, success, fail)
  • decode bitmap

    QRCodeParser().decodeBitmap(originBitmap, success, fail)

About

使用 CameraX 实现的 ZXing 二维码封装库

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published