public class DetectionOverlayView extends java.lang.Object implements DocumentCaptureContract.OverlayView
Constructor and Description |
---|
DetectionOverlayView(DetectionOverlayStrings strings,
int style) |
DetectionOverlayView(DetectionOverlayStrings strings,
int style,
boolean showTopButtons) |
Modifier and Type | Method and Description |
---|---|
void |
bindOverlayController(DocumentCaptureContract.OverlayController overlayController)
Bind given overlay controller to this view.
|
void |
cleanup()
Called when view will not be used anymore, here you should finish all remaining view actions
and its resources.
|
void |
clearAction()
Clears all displayed actions.
|
void |
clearDetection()
Clears all document detection information.
|
void |
createLayout(android.content.Context context,
RecognizerRunnerView parentView)
Inflate your custom layout here and add it to the parent view.
|
void |
onConfigurationChanged(RecognizerRunnerView recognizerRunnerview,
android.content.res.Configuration newConfiguration)
Called on device configuration change.
|
void |
onScanStarted()
Performs UI modifications when scanning is started.
|
void |
onTorchStateChanged(boolean torchOn)
Called when torch state is changed, when it is turned off or on.
|
void |
onTorchSupportStatusAvailable(boolean cameraSupportsTorch)
Called when camera device torch support status is available.
|
void |
showAction(DocumentCaptureAction action)
Displays some action message the to user.
|
void |
showDetection(DisplayableQuadDetection quadDetection)
Displays given detection to the user.
|
void |
showScanSuccess(DocumentCaptureContract.UiUpdateListener uiUpdateListener)
Displays the scan success.
|
public DetectionOverlayView(@NonNull DetectionOverlayStrings strings, @StyleRes int style, boolean showTopButtons)
public DetectionOverlayView(@NonNull DetectionOverlayStrings strings, @StyleRes int style)
public void bindOverlayController(DocumentCaptureContract.OverlayController overlayController)
DocumentCaptureContract.OverlayView
bindOverlayController
in interface DocumentCaptureContract.OverlayView
overlayController
- overlay controller that should be used for view actions.@NonNull public void createLayout(@NonNull android.content.Context context, @NonNull RecognizerRunnerView parentView)
DocumentCaptureContract.OverlayView
createLayout
in interface DocumentCaptureContract.OverlayView
context
- application contextparentView
- root view to be used as inflation parentpublic void onConfigurationChanged(RecognizerRunnerView recognizerRunnerview, android.content.res.Configuration newConfiguration)
DocumentCaptureContract.OverlayView
onConfigurationChanged
in interface DocumentCaptureContract.OverlayView
public void onTorchSupportStatusAvailable(boolean cameraSupportsTorch)
DocumentCaptureContract.OverlayView
onTorchSupportStatusAvailable
in interface DocumentCaptureContract.OverlayView
cameraSupportsTorch
- whether used camera supports torchpublic void onTorchStateChanged(boolean torchOn)
DocumentCaptureContract.OverlayView
onTorchStateChanged
in interface DocumentCaptureContract.OverlayView
torchOn
- true
if torch is turned on, false
if torch is turned off.public void clearDetection()
DocumentCaptureContract.OverlayView
clearDetection
in interface DocumentCaptureContract.OverlayView
public void showDetection(DisplayableQuadDetection quadDetection)
DocumentCaptureContract.OverlayView
showDetection
in interface DocumentCaptureContract.OverlayView
quadDetection
- detection location with status.public void onScanStarted()
DocumentCaptureContract.OverlayView
onScanStarted
in interface DocumentCaptureContract.OverlayView
public void showScanSuccess(DocumentCaptureContract.UiUpdateListener uiUpdateListener)
DocumentCaptureContract.OverlayView
showScanSuccess
in interface DocumentCaptureContract.OverlayView
uiUpdateListener
- listener that will be notified when all UI actions are finished
(UI changes, animations...).public void showAction(DocumentCaptureAction action)
DocumentCaptureContract.OverlayView
showAction
in interface DocumentCaptureContract.OverlayView
action
- action that should be displayed.public void clearAction()
DocumentCaptureContract.OverlayView
clearAction
in interface DocumentCaptureContract.OverlayView
public void cleanup()
DocumentCaptureContract.OverlayView
cleanup
in interface DocumentCaptureContract.OverlayView