Messages Settings

To use, simply instantiate a MessageSettings object and use the methods as needed for customization.

Method
Description
Default Value

.setPopupDocumentSubtitleMessage(message: Int)

Subtitle message in the pop-up showing the document illustration.

"Place the document on a desk, center it on the frame, and hold for capture."

.setFitTheDocumentMessage(message: Int)

Message prompting the user to fit the document to the frame.

"Fit the document on the frame."

.setHoldItMessage(message: Int)

Message shown during the capture process.

"Keep it steady."

.setVerifyingQualityMessage(message: Int)

Message displayed during the quality verification request.

"Checking document..."

.setLowQualityDocumentMessage(message: Int)

Message shown when the document capture fails due to low quality.

"Couldn't read the information. Please try again."

.setUploadingImageMessage(message: Int)

Message shown when saving the captured image to the server.

"Uploading image..."

.setShowOpenDocumentErrorMessage(show: Boolean, message: Int)

Message shown if an open document is detected.

"Close your document and try again."

.setWaitMessage(show: Boolean, message: Int)

Message displayed when starting the camera.

"Please wait..."

.setSensorLuminosityMessage(message: Int)

Message shown when the brightness level is too low.

"The area is too dark."

.setSensorOrientationMessage(message: Int)

Message shown when the orientation threshold is not met.

"Point the camera downward."

.setSensorStabilityMessage(message: Int)

Message shown when the device is not stable enough.

"Hold the device steady."

.setWrongDocumentTypeMessageResourceId(message: Int)

Message shown when the document type is incorrect. Use %1$s for the expected document.

"This document is not %1$s."

.setPositiveButtonMessage(message: Int)

Customizes the confirmation button text.

"OK, got it."

.setUploadedImageIsTooLargeTitle(message: Int)

Title for the upload popup when the file exceeds the max size.

"File size exceeded."

.setUploadedImageIsTooLargeMessage(message: Int)

Message for the upload popup when the file exceeds the max size. Use %1$s for max size.

"The file exceeds the max size of %1$d MB. Upload a smaller file."

.setUploadedImageHasInvalidFormatTitle(message: Int)

Title for the upload popup when the file format is invalid.

"Invalid format."

.setUploadedImageNotSupportedFormatMessage(message: Int)

Message for unsupported file formats in the upload popup.

"Unsupported file format. Use JPG, PNG, or PDF."

.setUploadedImageGenericErrorTitle(message: Int)

Generic error title for the upload popup.

"Something went wrong."

.setUploadedImageWrongMessage(message: Int)

Message for an unexpected document in the upload popup.

"This is not the expected document. Upload the correct one."

.setUploadedImageLowQualityTitle(message: Int)

Title for the upload popup when the image quality is low.

"Low quality image."

.setUploadedImageLowQualityMessage(message: Int)

Message for low-quality images in the upload popup.

"The image quality is too low. Upload a better one."

.setUploadPopupLoadingMessage(message: Int)

Message shown during file upload in the popup.

"Uploading document..."

.setPredictorScanDocumentMessage(resId: Int)

Message prompting the user to scan a document.

"Scan a document."

.setPredictorGetCloserMessage(resId: Int)

Message asking the user to get closer to the document.

"Move closer to the document."

.setPredictorCentralizeMessage(resId: Int)

Message asking the user to center the document.

"Center the document."

.setPredictorMoveAwayMessage(resId: Int)

Message asking the user to move away from the document.

"Move farther from the document."

.setPredictorAlignDocumentMessage(resId: Int)

Message asking the user to align the document.

"Align the document."

.setPredictorTurnDocumentMessage(resId: Int)

Message asking the user to rotate the document 90 degrees.

"Rotate the document โคต๏ธ."

.setPredictorCapturedMessage(resId: Int)

Message confirming the document has been captured.

"Document captured."

.setUnsupportedDocumentMessage(message: Int)

Message for unsupported documents.

"This document is not supported."

.setDocumentNotFoundMessage(message: Int)

Message when no document is detected.

"No document found."

Example

val messageSettings = MessageSetings()
    .setFitTheDocumentMessage(R.string.example_resource)
    .setHoldItMessage(R.string.example_resource);

Last updated

Logo

2023 ยฉ Caf. - All rights reserved