package com.example.wgapplink import android.view.View import com.journeyapps.barcodescanner.CaptureActivity import com.journeyapps.barcodescanner.DecoratedBarcodeView /** * The screen behind an app's "Scan QR code" button: zxing-android-embedded's capture activity with * two of its defaults taken off, both because they put work on the person holding the phone. * * - **It decodes only the framing rectangle**, which `CameraPreview.marginFraction` insets by 10% * from every edge and `DecoderThread` crops each frame to before the decoder sees it. A code that * fills the viewfinder keeps decoding -- measured, not assumed -- but it does so having spent its * quiet zone and margin for error on the crop, and anything further out is simply not looked at. * Decoding the whole preview costs nothing and means the framing is never the user's problem. * - **It decorates the preview** with a red laser line and the dots the detector scatters wherever * it finds a candidate pattern. That is the library's house style; a plain preview is ours. * * Orientation is left to the sensor rather than pinned to landscape as the library's own manifest * entry pins it, so the phone can be held whichever way the code is in front of it. */ class EnrollmentScanActivity : CaptureActivity() { override fun initializeContent(): DecoratedBarcodeView { val view = super.initializeContent() view.barcodeView.marginFraction = 0.0 view.viewFinder.visibility = View.GONE view.statusView.visibility = View.GONE return view } }