ReviewFragmentListener

Interface used by ReviewFragmentStandard and ReviewFragmentCompat to dispatch events to the hosting Activity.

public interface ReviewFragmentListener

Functions

onDocumentReviewedAndAnalyzed
Link copied to clipboard

Called if you called onDocumentAnalyzed or and the image wasn't changed and the user tapped on the Next button.

You should finish your Activity and proceed to handling the results of the analysis.

abstract void onDocumentReviewedAndAnalyzed(Document document)
onDocumentWasRotated
Link copied to clipboard

Called when the user rotated the image.

In case you started the document analysis in onShouldAnalyzeDocument you should cancel it here as the original image is not valid anymore.

abstract void onDocumentWasRotated(Document document, int oldRotation, int newRotation)
onError
Link copied to clipboard

Called when an error occurred.

abstract void onError(GiniVisionError error)
onExtractionsAvailable
Link copied to clipboard

Called when the document has been analyzed and extractions are available.

abstract void onExtractionsAvailable(Map<String, GiniVisionSpecificExtractionextractions)
onProceedToAnalysisScreen
Link copied to clipboard

Called if you didn't call onDocumentAnalyzed or (or the image was changed) and the user tapped on the Next button.

You should start your Activity extending AnalysisActivity and set the document as the EXTRA_IN_DOCUMENT extra.

abstract void onProceedToAnalysisScreen(Document document)

Called when the user tapped on the Next button and one of the following conditions apply:

  • Analysis is in progress
  • Analysis completed with an error
  • The image was rotated

    You should start your Activity extending AnalysisActivity and set the document as the EXTRA_IN_DOCUMENT extra.

abstract void onProceedToAnalysisScreen(Document document, String errorMessage)
onProceedToNoExtractionsScreen
Link copied to clipboard

Called when the document has been analyzed and no extractions were received.

You should show the NoResultsFragmentStandard or .

abstract void onProceedToNoExtractionsScreen(Document document)
onShouldAnalyzeDocument
Link copied to clipboard

Called when the Review Fragment was started and you should start analyzing the original document by sending it to the Gini API.

We assume that in most cases the photo is good enough and this way we are able to provide analysis results quicker.

Note: Call onDocumentAnalyzed or when the analysis is done and your Activity wasn't stopped.

abstract void onShouldAnalyzeDocument(Document document)

Inheritors

ReviewActivity
Link copied to clipboard