QRScanActivity

public final class QRScanActivity extends AppCompatActivity implements QRCodeReaderListener

Activity to scan the QR code and navigate to a face capture activity

Constructors

Link copied to clipboard

Types

Link copied to clipboard
public class Companion

Properties

Link copied to clipboard
private final BarcodeReader barCodeReader

The QR code reader

Link copied to clipboard
private Camera camera

The camera

Link copied to clipboard
private ListenableFuture<ProcessCameraProvider> cameraProviderFuture

The camera provider future

Link copied to clipboard
public final static QRScanActivity.Companion Companion
Link copied to clipboard
private final static String EXTRA_TYPE

The extra for the type of the QR scan

Link copied to clipboard

The frame view showing the pinch to zoom animation

Link copied to clipboard

Whether the pinch to zoom hint has been shown (it is only shown once)

Link copied to clipboard
private ImageView ivBack

The button to go back to the previous screen

Link copied to clipboard

The image to select qr code from gallery

Link copied to clipboard

The camera view

Link copied to clipboard

The scan analyzer which processes the QR code

Link copied to clipboard

The password entered by the user

Link copied to clipboard
private final static String TYPE_CLEAR_DATA

When the EXTRA_TYPE is TYPE_CLEAR_DATA, the request is to get clear text data from QR

Functions

Link copied to clipboard
private final Unit bindPreview(ProcessCameraProvider cameraProvider)

This method is used to bind the preview to the camera.

Link copied to clipboard
private final Dialog createPasswordDialog(View.OnClickListener continueListener)

This method is used to create a dialog to enter the password

Link copied to clipboard
private final BarcodeReader getBarCodeReader()

The QR code reader

Link copied to clipboard
private final Camera getCamera()

The camera

Link copied to clipboard
private final ListenableFuture<ProcessCameraProvider> getCameraProviderFuture()

The camera provider future

Link copied to clipboard
private final FrameLayout getFlPinchToZoom()

The frame view showing the pinch to zoom animation

Link copied to clipboard
private final ImageView getIvBack()

The button to go back to the previous screen

Link copied to clipboard
private final ImageView getIvGallery()

The image to select qr code from gallery

Link copied to clipboard
private final PreviewView getPvCamera()

The camera view

Link copied to clipboard
private final QrAnalyzer getQrAnalyzer()

The scan analyzer which processes the QR code

Link copied to clipboard
private final String getQrPassword()

The password entered by the user

Link copied to clipboard
private final Unit hidePinchToZoomHint()

This method is used to hide the pinch to zoom hint.

Link copied to clipboard
private final Boolean isClearTextRequest()

This method is used to check if the request is for clear text data.

Link copied to clipboard

Whether the pinch to zoom hint has been shown (it is only shown once)

Link copied to clipboard
private final Unit navigateToNextActivity(SensePrintInfo spInfo, ByteArray spBytes, String password)

For navigating to next activity based on qr scan type

Link copied to clipboard
protected Unit onActivityResult(Integer requestCode, Integer resultCode, Intent data)
Link copied to clipboard
protected Unit onCreate(Bundle savedInstanceState)
Link copied to clipboard
protected Unit onPause()
Link copied to clipboard

Called when an error occurs while processing the QR code.

Link copied to clipboard

This method is used to handle the QR code bytes once they are available.

Link copied to clipboard
protected Unit onResume()

Reset state and start camera when the activity is resumed

Link copied to clipboard
private final Unit processQR(SensePrintInfo spInfo, ByteArray spBytes)

This method is used to process the QR code once it is scanned.

Link copied to clipboard
private final Unit setCamera(Camera camera)

The camera

Link copied to clipboard
private final Unit setCameraProviderFuture(ListenableFuture<ProcessCameraProvider> cameraProviderFuture)

The camera provider future

Link copied to clipboard
private final Unit setFlPinchToZoom(FrameLayout flPinchToZoom)

The frame view showing the pinch to zoom animation

Link copied to clipboard
private final Unit setIvBack(ImageView ivBack)

The button to go back to the previous screen

Link copied to clipboard
private final Unit setIvGallery(ImageView ivGallery)

The image to select qr code from gallery

Link copied to clipboard
private final Unit setPinchToZoomHintShown(Boolean isPinchToZoomHintShown)

Whether the pinch to zoom hint has been shown (it is only shown once)

Link copied to clipboard
private final Unit setPvCamera(PreviewView pvCamera)

The camera view

Link copied to clipboard
private final Unit setQrAnalyzer(QrAnalyzer qrAnalyzer)

The scan analyzer which processes the QR code

Link copied to clipboard
private final Unit setQrPassword(String qrPassword)

The password entered by the user

Link copied to clipboard
private final Unit setupComponents()

This method is used to set up the components in this activity.

Link copied to clipboard
private final Unit setUpListeners()

This method is used to set up the listeners for the components in this activity.

Link copied to clipboard

This method is used to set up the tap to focus and pinch to zoom functionality.

Link copied to clipboard
private final Unit showErrorDialog(SenseCryptSdkException e)

This method is used to show an error dialog.

Link copied to clipboard
private final Unit showInvalidQr()

This method is used to show an error message when the QR code is invalid.

Link copied to clipboard
private final Unit showPasswordDialog(SensePrintInfo spInfo, ByteArray spBytes)

This method is used to show a dialog to enter the password.

Link copied to clipboard
private final Unit showPasswordIncorrectDialog(SensePrintInfo spInfo, ByteArray spBytes)

This method is used to show a dialog to indicate that the password is incorrect.

Link copied to clipboard
private final Unit showPinchToZoomHint()

This method is used to show the pinch to zoom hint.

Link copied to clipboard
private final Unit startCamera()

This method is used to start the camera.