public class ThreeStepsFlowController extends Object
The flow starts with the camera zoomed out and is in a state where it's waiting for a code to be scanned (step 1). If a code is read and is sufficiently centered (in a position that still makes it visible with the 4x zoom), then the zoom in is done and the controller will be waiting for a code that meets the size constraint (step 2). Otherwise, the user will be told that he needs to center the code. As soon as a code meets the size constraint in the Fit QR state, the torch is turned on and as soon as the white balance is stabilised, the regular authentication process kicks in (step 3).
Modifier and Type | Class and Description |
---|---|
static class |
ThreeStepsFlowController.Builder
Builder class for the three steps controller.
|
static interface |
ThreeStepsFlowController.ThreeStepsCallback
Callback interface for the flow events.
|
Modifier and Type | Method and Description |
---|---|
void |
doAutoFocus(float motionX,
float motionY,
int viewWidth,
int viewHeight)
Triggers the camera's auto-focus on the provided touch location.
|
View |
getPreviewView()
Returns the View that was created by the manager and on which the camera preview is drawn.
|
void |
pauseProcessing()
Pauses the ScanTrust frame processing.
|
void |
releaseCamera()
Releases the underlying camera object, stops the preview and stops the ScanTrust frame processing.
|
void |
resetFlow()
Resets the state of the flow to only reading the content of the codes.
|
void |
restartProcessing()
Restarts the ScanTrust frame processing.
|
void |
setCameraTorchModeOnOff(boolean turnOn)
Turns the torch on or off depending on the value of turnOn.
|
void |
startCamera()
Starts the underlying camera object, its preview and starts the ScanTrust frame processing.
|
public void resetFlow()
public void restartProcessing()
public void pauseProcessing()
public void startCamera()
public void releaseCamera()
public void setCameraTorchModeOnOff(boolean turnOn)
turnOn
- true to turn the torch onpublic void doAutoFocus(float motionX, float motionY, int viewWidth, int viewHeight)
View.OnTouchListener.onTouch(View, MotionEvent)
The view's dimensions are required to map the touch to the sensor's space.motionX
- The x touch locationmotionY
- The y touch locationviewWidth
- The view's widthviewHeight
- The views' heightpublic View getPreviewView()