public class

QRCodeReaderScreen

extends FrameLayout
java.lang.Object
   ↳ android.view.View
     ↳ android.view.ViewGroup
       ↳ android.widget.FrameLayout
         ↳ com.sap.cloud.mobile.fiori.qrcode.QRCodeReaderScreen

Class Overview

A new implementation of barcode scanner which provide offline version of barcode scan without google play services. Simplify the API that user can call one API to get the qr code result

Summary

Nested Classes
interface QRCodeReaderScreen.BarCodeValidator Interface for barcode validation  
class QRCodeReaderScreen.InvisibleFragment Fragment for request permission and open system gallery  
interface QRCodeReaderScreen.OnMultiBarCodeDetectorListener Interface for barcode detect  
[Expand]
Inherited Constants
From class android.view.ViewGroup
From class android.view.View
[Expand]
Inherited Fields
From class android.view.View
Public Constructors
QRCodeReaderScreen(Context context)
QRCodeReaderScreen(Context context, AttributeSet attrs)
QRCodeReaderScreen(Context context, AttributeSet attrs, int defStyleAttr)
QRCodeReaderScreen(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)
Public Methods
void enableOrientationListener()
Enable the orientation listener if the activity will not be destroyed and recreated after device rotation
ImageView getCloseReader()
ImageView getPhotoLibrary()
ProgressBar getProgressBar()
void reStartScan()
Restarts qr code scan
void setBarCodeListener(LifecycleOwner lifecycleOwner, QRCodeReaderScreen.OnMultiBarCodeDetectorListener barCodeDetectorListener)
Attach LifeCycleOwner, please note this method must have the camera permission
void setBarCodeValidator(QRCodeReaderScreen.BarCodeValidator validator)
Sets the validator for barcode
void setCameraNoticeSettings(PrivacyNoticeSettings settings)
Sets the settings for camera privacy notice dialog
void setCloseReaderButtonOnClickListener(View.OnClickListener listener)
Sets click event for close reader button
void setPhotoLibraryButtonOnClickListener(View.OnClickListener listener)
Sets click event listener for photo library
void setQRConfig(QRCodeConfig qrConfig)
Sets QR code config
void setStorageSettings(PrivacyNoticeSettings settings)
Sets the settings for storage privacy notice dialog
void stop()
Stops camera and Release the resources
void stopScan()
Stops scan camera
Protected Methods
void onDetachedFromWindow()
[Expand]
Inherited Methods
From class android.widget.FrameLayout
From class android.view.ViewGroup
From class android.view.View
From class java.lang.Object
From interface android.graphics.drawable.Drawable.Callback
From interface android.view.KeyEvent.Callback
From interface android.view.ViewManager
From interface android.view.ViewParent
From interface android.view.accessibility.AccessibilityEventSource

Public Constructors

public QRCodeReaderScreen (Context context)

public QRCodeReaderScreen (Context context, AttributeSet attrs)

public QRCodeReaderScreen (Context context, AttributeSet attrs, int defStyleAttr)

public QRCodeReaderScreen (Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes)

Public Methods

public void enableOrientationListener ()

Enable the orientation listener if the activity will not be destroyed and recreated after device rotation

public ImageView getCloseReader ()

public ImageView getPhotoLibrary ()

public ProgressBar getProgressBar ()

public void reStartScan ()

Restarts qr code scan

Throws
SecurityException Permission has handled internally

public void setBarCodeListener (LifecycleOwner lifecycleOwner, QRCodeReaderScreen.OnMultiBarCodeDetectorListener barCodeDetectorListener)

Attach LifeCycleOwner, please note this method must have the camera permission

Parameters
lifecycleOwner Activity or Fragment to bind with the ERROR(/QRCodePreview)
barCodeDetectorListener Listener to detect the barcode
Throws
SecurityException The method need permission of camera

public void setBarCodeValidator (QRCodeReaderScreen.BarCodeValidator validator)

Sets the validator for barcode

Parameters
validator Validator for barcode

public void setCameraNoticeSettings (PrivacyNoticeSettings settings)

Sets the settings for camera privacy notice dialog

Parameters
settings The settings for privacy notice dialog

public void setCloseReaderButtonOnClickListener (View.OnClickListener listener)

Sets click event for close reader button

Parameters
listener Click listener for close reader button

public void setPhotoLibraryButtonOnClickListener (View.OnClickListener listener)

Sets click event listener for photo library

Parameters
listener Click listener for photo library button

public void setQRConfig (QRCodeConfig qrConfig)

Sets QR code config

Parameters
qrConfig Config for camera

public void setStorageSettings (PrivacyNoticeSettings settings)

Sets the settings for storage privacy notice dialog

Parameters
settings The settings for privacy notice dialog

public void stop ()

Stops camera and Release the resources

public void stopScan ()

Stops scan camera

Protected Methods

protected void onDetachedFromWindow ()